-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e5262f
commit 2435145
Showing
5 changed files
with
104 additions
and
10 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
55 changes: 55 additions & 0 deletions
55
apps/web/src/components/SendFlow/InsufficientFunds/InsufficientFunds.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,55 @@ | ||
import { | ||
Button, | ||
Flex, | ||
Heading, | ||
Link, | ||
ModalBody, | ||
ModalContent, | ||
ModalFooter, | ||
ModalHeader, | ||
Text, | ||
} from "@chakra-ui/react"; | ||
import { useDynamicModalContext } from "@umami/components"; | ||
import { useBuyTezUrl, useCurrentAccount } from "@umami/state"; | ||
|
||
import { ExternalLinkIcon, WalletIcon } from "../../../assets/icons"; | ||
import { useColor } from "../../../styles/useColor"; | ||
import { ModalCloseButton } from "../../CloseButton"; | ||
|
||
export const InsufficientFunds = () => { | ||
const color = useColor(); | ||
const currentAccount = useCurrentAccount(); | ||
const buyTezUrl = useBuyTezUrl(currentAccount!.address.pkh); | ||
|
||
const { onClose } = useDynamicModalContext(); | ||
|
||
return ( | ||
<ModalContent> | ||
<ModalHeader marginBottom="12px"> | ||
<Flex alignItems="center" justifyContent="center" flexDirection="column" gap="18px"> | ||
<WalletIcon width="24px" color={color("400")} /> | ||
<Heading size="xl">Insufficient Funds</Heading> | ||
</Flex> | ||
<ModalCloseButton /> | ||
</ModalHeader> | ||
<ModalBody> | ||
<Text color={color("700")} fontWeight="400" textAlign="center" size="md"> | ||
Oops, looks like you don't have enough funds on your account. | ||
</Text> | ||
</ModalBody> | ||
<ModalFooter> | ||
<Button | ||
as={Link} | ||
width="full" | ||
href={buyTezUrl} | ||
isExternal | ||
leftIcon={<ExternalLinkIcon />} | ||
onClick={onClose} | ||
variant="primary" | ||
> | ||
Buy Tez | ||
</Button> | ||
</ModalFooter> | ||
</ModalContent> | ||
); | ||
}; |
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 @@ | ||
export * from "./InsufficientFunds"; |
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