Skip to content

CSI 1537 Changelly Integration - #376

Draft
arnabCypherock wants to merge 16 commits into
stagingfrom
CSI-1537_Build-swap-transaction-flow-hooks_Arnab-Sen
Draft

CSI 1537 Changelly Integration#376
arnabCypherock wants to merge 16 commits into
stagingfrom
CSI-1537_Build-swap-transaction-flow-hooks_Arnab-Sen

Conversation

@arnabCypherock

Copy link
Copy Markdown

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
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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