Skip to content

Commit

Permalink
fix(dw): add share btn next to preflight and describe it
Browse files Browse the repository at this point in the history
  • Loading branch information
javadkh2 committed Jan 21, 2025
1 parent c51d35c commit 2fe53b2
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,29 @@ function TxStatusList({
{sendDisabled ? 'Transaction is pending' : 'Ready to preflight'}
</Stack>
</Text>
<Text size="small">
Preflight will test your transaction first to avoid paying gas for a
failed submission.
</Text>
{variant === 'expanded' && (
<Button
isCompact
onClick={() => onPreflight()}
isDisabled={sendDisabled}
startVisual={<MonoViewInAr />}
>
Preflight transaction
</Button>
<Stack gap={'sm'}>
<Button
isCompact
onClick={() => onPreflight()}
isDisabled={sendDisabled}
startVisual={<MonoViewInAr />}
>
Preflight
</Button>
<Button
variant="outlined"
startVisual={<MonoShare />}
isCompact
onClick={copyTx}
>
{copied ? 'copied' : 'Share'}
</Button>
</Stack>
)}
</Stack>
),
Expand Down Expand Up @@ -282,14 +296,24 @@ function TxStatusList({
</Stack>
</Text>
{variant === 'expanded' && (
<Button
isCompact
onClick={() => onSubmit()}
isDisabled={sendDisabled}
startVisual={<MonoViewInAr />}
>
Send transaction
</Button>
<Stack gap={'sm'}>
<Button
isCompact
onClick={() => onSubmit()}
isDisabled={sendDisabled}
startVisual={<MonoViewInAr />}
>
Send tx
</Button>
<Button
variant="outlined"
startVisual={<MonoShare />}
isCompact
onClick={copyTx}
>
{copied ? 'copied' : 'Share'}
</Button>
</Stack>
)}
</Stack>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ export const TxTile = ({
paddingBlockEnd={'sm'}
>
<Text size="small">
The transaction is Signed; you can now call preflight
{sendDisabled
? 'Waiting for redistribution to complete'
: 'The transaction is Signed; you can now call preflight'}
</Text>
</Stack>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,26 @@ export function TransferForm({
onSubmit(
{
...data,
receivers: [
...data.receivers,
...xchainSameAccount.map((x) => ({
amount: x.amount,
address: senderAccount.address,
chain: x.target,
xchain: true,
chunks: [
{
amount: x.amount,
chainId: x.source,
},
],
discoveredAccount: senderAccount,
})),
],
gasPayer: data.gasPayer || data.senderAccount,
creationTime: data.creationTime ?? Math.floor(Date.now() / 1000),
},
[...xchainSameAccount, ...redistribution],
[...redistribution],
);
}

Expand Down

0 comments on commit 2fe53b2

Please sign in to comment.