-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add recipient confirmation modal (#402)
- Create recipient confirmation modal - Check recipient balance before transition to Review step - Rename SolidButton classes prop
- Loading branch information
Showing
5 changed files
with
102 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Modal } from '@hyperlane-xyz/widgets'; | ||
import { useFormikContext } from 'formik'; | ||
import { SolidButton } from '../../components/buttons/SolidButton'; | ||
import { TransferFormValues } from './types'; | ||
|
||
export function RecipientConfirmationModal({ | ||
isOpen, | ||
close, | ||
onConfirm, | ||
}: { | ||
isOpen: boolean; | ||
close: () => void; | ||
onConfirm: () => void; | ||
}) { | ||
const { values } = useFormikContext<TransferFormValues>(); | ||
return ( | ||
<Modal | ||
isOpen={isOpen} | ||
close={close} | ||
title="Confirm Recipient Address" | ||
panelClassname="flex flex-col items-center p-4 gap-5" | ||
> | ||
<p className="text-center text-sm"> | ||
The recipient address has no funds on the destination chain. Is this address correct? | ||
</p> | ||
<p className="rounded-lg bg-primary-500/5 p-2 text-center text-sm">{values.recipient}</p> | ||
<div className="flex items-center justify-center gap-12"> | ||
<SolidButton onClick={close} color="gray" className="min-w-24 px-4 py-1"> | ||
Cancel | ||
</SolidButton> | ||
<SolidButton | ||
onClick={() => { | ||
close(); | ||
onConfirm(); | ||
}} | ||
color="primary" | ||
className="min-w-24 px-4 py-1" | ||
> | ||
Continue | ||
</SolidButton> | ||
</div> | ||
</Modal> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters