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

fix(dw): add share btn next to preflight and describe it #2815

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading