Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSI 1537 Changelly Integration #376

Draft
wants to merge 16 commits into
base: staging
Choose a base branch
from

Conversation

arnabCypherock
Copy link

No description provided.

@arnabCypherock arnabCypherock changed the base branch from main to dev January 23, 2023 12:13
@arnabCypherock arnabCypherock changed the base branch from dev to staging January 23, 2023 12:13
@arnabCypherock arnabCypherock changed the base branch from staging to prerelease/1.1.257+ January 23, 2023 12:14
@irshadCypherock irshadCypherock marked this pull request as draft January 24, 2023 11:17
@@ -68,6 +68,8 @@ export enum CysyncError {
RECEIVE_TXN_CANCEL_FAILED = 'DS_OPTS_1507',
RECEIVE_TXN_UNKNOWN_ERROR = 'DS_MISC_5502',

SWAP_TXN_UNKNOWN_ERROR = 'TODO_1234', // TODO: add error code
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a code here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you suggest me the code? Is there any format that we follow? What does the number at the end signify?

Comment on lines +188 to +191
{
tab: 10, // this is a dummy value for the Swap tab
route: Routes.swap.index //TODO: Update the route
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add it at the 2nd last index of array and remove comments

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also update the values of tab index

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The values of just this particular tab or the rest of the tabs as well?

Comment on lines +20 to +21
id={`simple-tabpanel-${index}`}
aria-labelledby={`simple-tab-${index}`}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace generic name for ID and label by actual name

Comment on lines +60 to +69
style={{
width: '80%',
height: '88%',
position: 'absolute',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
zIndex: 100,
display: 'flex'
}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classes

@@ -0,0 +1,161 @@
import { CallReceived, ContentCopy } from '@mui/icons-material';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a panels folder. It can just be swap/dialog swap/exchange etc

);
};

export default function received() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Pascal Case for Component naming

Comment on lines +84 to +104
{
<SwapDetailsForm
fromToken={fromToken}
setFromToken={setFromToken}
toToken={toToken}
setToToken={setToToken}
amountToSend={amountToSend}
setAmountToSend={setAmountToSend}
handleChangeAmountToSend={handleChangeAmountToSend}
classesForm={classes.form}
allWallets={allWallets}
amountToReceive={amountToReceive || '0'}
price={toToken?.price || 0}
toWallet={toWallet}
setToWallet={setToWallet}
fromWallet={fromWallet}
fromWalletCoinData={fromWalletCoinData}
toWalletCoinData={toWalletCoinData}
setFromWallet={setFromWallet}
/>
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove brackets

Comment on lines +143 to +171
{showSwapDetailsVerifyDialog && (
<VerifySwapDetailsDialog
open={showSwapDetailsVerifyDialog}
onClose={() => {
cancelSwapTransaction();
setShowSwapDetailsVerifyDialog(false);
}}
amountToSend={amountToSend}
amountToReceive={amountToReceive}
networkFees={fees}
sourceCoinSlug={COINS[fromToken.coinId].abbr.toUpperCase()}
sourceCoinName={fromToken.coinId}
targetCoinSlug={COINS[toToken.coinId].abbr.toUpperCase()}
targetCoinName={toToken.coinId}
receiveAddress={receiveAddress}
receiveFlowStep={receiveFlowStep}
sendFlowStep={sendFlowStep}
/>
)}
{showSwapCompletedDialog && (
<SwapCompletedDialog
open={showSwapCompletedDialog}
onClose={() => {
setSwapCompletedDialog(false);
}}
toTokenName={COINS[toToken.coinId]?.name}
transactionId={swapTransaction.changellyTxnId}
/>
)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need conditional rendering when we are passing the open prop

@@ -0,0 +1,817 @@
import {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file it too large, try splitting it into different files

@irshadCypherock
Copy link
Collaborator

@arnabCypherock arnabCypherock changed the base branch from prerelease/1.1.257+ to main March 9, 2023 06:44
@arnabCypherock arnabCypherock changed the base branch from main to staging March 9, 2023 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants