Skip to content

Commit

Permalink
Conditionally show the Nonce Input on Send Assets modal
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgall committed Sep 17, 2024
1 parent a078b65 commit 0b68896
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ export default function RoleFormCreateProposal({ close }: { close: () => void })
>
<SendAssetsModal
submitButtonText={t('add')}
showNonceInput={false}
close={onCloseAssets}
sendAssetsData={addSendAssetsAction}
/>
Expand Down
12 changes: 8 additions & 4 deletions src/components/ui/modals/SendAssetsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ export interface SendAssetsData {

export function SendAssetsModal({
submitButtonText,
showNonceInput,
close,
sendAssetsData,
}: {
submitButtonText: string;
showNonceInput: boolean;
close: () => void;
sendAssetsData: (sendAssetData: SendAssetsData) => void;
}) {
Expand Down Expand Up @@ -215,10 +217,12 @@ export function SendAssetsModal({

<Divider my="1.5rem" />

<CustomNonceInput
nonce={nonceInput}
onChange={nonce => setNonceInput(nonce ? parseInt(nonce) : undefined)}
/>
{showNonceInput && (
<CustomNonceInput
nonce={nonceInput}
onChange={nonce => setNonceInput(nonce ? parseInt(nonce) : undefined)}
/>
)}

<Button
marginTop="2rem"
Expand Down
1 change: 1 addition & 0 deletions src/pages/daos/[daoAddress]/treasury/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export default function Treasury() {
>
<SendAssetsModal
submitButtonText={t('submitProposal', { ns: 'modals' })}
showNonceInput={true}
close={onClose}
sendAssetsData={sendAssetsAction}
/>
Expand Down

0 comments on commit 0b68896

Please sign in to comment.