-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wallet-dashboard): add receive popup (#3772)
* feat(wallet-dashboard): add receive popup * styles: add margin Co-authored-by: evavirseda <[email protected]> --------- Co-authored-by: evavirseda <[email protected]>
- Loading branch information
1 parent
112e777
commit f3d9af4
Showing
11 changed files
with
566 additions
and
432 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
1 change: 1 addition & 0 deletions
1
apps/wallet/src/ui/app/components/QR.tsx → apps/core/src/components/QR.tsx
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export * from './KioskClientProvider'; | ||
export * from './QR'; |
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
47 changes: 47 additions & 0 deletions
47
apps/wallet-dashboard/components/Dialogs/ReceiveFundsDialog.tsx
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,47 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { Button, Address, Dialog, DialogContent, DialogBody, Header } from '@iota/apps-ui-kit'; | ||
import { useCopyToClipboard } from '@iota/core'; | ||
import { QR } from '@iota/core'; | ||
import toast from 'react-hot-toast'; | ||
|
||
interface ReceiveFundsDialogProps { | ||
address: string; | ||
setOpen: (bool: boolean) => void; | ||
open: boolean; | ||
} | ||
|
||
export function ReceiveFundsDialog({ | ||
address, | ||
open, | ||
setOpen, | ||
}: ReceiveFundsDialogProps): React.JSX.Element { | ||
const copyToClipboard = useCopyToClipboard(); | ||
|
||
async function handleCopyToClipboard() { | ||
const success = await copyToClipboard(address); | ||
if (success) { | ||
toast.success('Address copied'); | ||
} | ||
} | ||
|
||
return ( | ||
<Dialog open={open} onOpenChange={setOpen}> | ||
<DialogContent containerId="overlay-portal-container"> | ||
<Header title="Receive" onClose={() => setOpen(false)} /> | ||
<DialogBody> | ||
<div className="flex flex-col gap-lg text-center [&_span]:w-full [&_span]:break-words"> | ||
<div className="self-center"> | ||
<QR value={address} size={130} marginSize={2} /> | ||
</div> | ||
<Address text={address} /> | ||
</div> | ||
</DialogBody> | ||
<div className="flex w-full flex-row justify-center gap-2 px-md--rs pb-md--rs pt-sm--rs"> | ||
<Button onClick={handleCopyToClipboard} fullWidth text="Copy Address" /> | ||
</div> | ||
</DialogContent> | ||
</Dialog> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export * from './ReceiveFundsDialog'; | ||
export * from './Staking'; |
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
Oops, something went wrong.