|
1 | 1 | import React from "react"
|
2 |
| -import { Box, Button, Flex, Icon, Text } from "@chakra-ui/react" |
| 2 | + |
| 3 | +import { Button } from "@/components/ui/buttons/Button" |
| 4 | +import { Flex, HStack } from "@/components/ui/flex" |
| 5 | + |
| 6 | +import { cn } from "@/lib/utils/cn" |
3 | 7 |
|
4 | 8 | import { EthTokenIcon } from "../../icons"
|
5 | 9 | import { NotificationPopover } from "../../NotificationPopover"
|
@@ -52,101 +56,67 @@ export const SendEther = ({
|
52 | 56 | }).format(chosenAmount)
|
53 | 57 |
|
54 | 58 | return (
|
55 |
| - <Box h="100%"> |
56 |
| - <Box px={6} py={8}> |
57 |
| - <Text |
58 |
| - fontSize={{ base: "xl", md: "2xl" }} |
59 |
| - fontWeight="bold" |
60 |
| - mb={{ base: 4, md: 6 }} |
61 |
| - > |
62 |
| - Send |
63 |
| - </Text> |
64 |
| - <Text mb={{ base: 0, md: 6 }}>How much do you want to send?</Text> |
65 |
| - </Box> |
66 |
| - <Flex |
67 |
| - px={6} |
68 |
| - py={{ base: 4, md: 6 }} |
69 |
| - borderTop="1px" |
70 |
| - borderBottom="1px" |
71 |
| - borderColor="background.highlight" |
72 |
| - gap={4} |
73 |
| - color="body.medium" |
74 |
| - fontSize="xs" |
75 |
| - > |
| 59 | + <div className="h-full"> |
| 60 | + <div className="px-6 py-8"> |
| 61 | + <p className="mb-4 text-xl font-bold md:mb-6 md:text-2xl">Send</p> |
| 62 | + <p className="md:mb-6">How much do you want to send?</p> |
| 63 | + </div> |
| 64 | + <Flex className="gap-4 border-y border-background-highlight px-6 py-4 text-xs text-body-medium md:py-6"> |
76 | 65 | {/* Left side: Displayed send amount */}
|
77 | 66 | <NotificationPopover
|
78 | 67 | title="Example walkthrough"
|
79 | 68 | content="Choose a value below"
|
80 | 69 | side="top"
|
81 | 70 | >
|
82 | 71 | <Flex
|
83 |
| - alignItems="top" |
84 |
| - flex={1} |
85 |
| - fontWeight="bold" |
86 |
| - color={chosenAmount > 0 ? "body.base" : "disabled"} |
| 72 | + className={cn( |
| 73 | + "flex-1 font-bold", |
| 74 | + chosenAmount > 0 ? "text-body" : "text-disabled" |
| 75 | + )} |
87 | 76 | >
|
88 |
| - <Text fontSize="6xl" h="full" lineHeight="1em"> |
| 77 | + <p className="h-full text-6xl leading-[1em]"> |
89 | 78 | {formatChosenAmount}
|
90 |
| - </Text> |
| 79 | + </p> |
91 | 80 | </Flex>
|
92 | 81 | </NotificationPopover>
|
93 | 82 | {/* Right side */}
|
94 |
| - <Flex direction="column" alignItems="end"> |
| 83 | + <Flex className="flex-col items-end"> |
95 | 84 | <NotificationPopover
|
96 | 85 | side="top"
|
97 | 86 | title="Example walkthrough"
|
98 | 87 | content="In this walkthrough you can only send ETH, but in real wallet you can send different tokens as well"
|
99 | 88 | >
|
100 | 89 | {/* Token selector pill */}
|
101 |
| - <Flex |
102 |
| - px={2} |
103 |
| - py={1} |
104 |
| - mb={4} |
105 |
| - borderRadius="full" |
106 |
| - bg="body.light" |
107 |
| - alignItems="center" |
108 |
| - > |
109 |
| - <Icon as={EthTokenIcon} fontSize="xl" me={1.5} /> |
110 |
| - <Text fontWeight="bold" m={0} color="body.base"> |
111 |
| - ETH |
112 |
| - </Text> |
113 |
| - </Flex> |
| 90 | + <HStack className="mb-4 gap-0 rounded-full bg-body-light px-2 py-1"> |
| 91 | + {/* TODO: remove flags and `size` class when icon is migrated */} |
| 92 | + <EthTokenIcon className="!me-1.5 !size-[1em] !text-xl" /> |
| 93 | + <p className="m-0 font-bold text-body">ETH</p> |
| 94 | + </HStack> |
114 | 95 | </NotificationPopover>
|
115 | 96 | {/* Balances */}
|
116 |
| - <Text fontWeight="bold" m={0} lineHeight={1}> |
117 |
| - Balance: {usdAmount} |
118 |
| - </Text> |
119 |
| - <Text m={0}> |
| 97 | + <p className="font-bold leading-none">Balance: {usdAmount}</p> |
| 98 | + <p> |
120 | 99 | <>{ethAmount} ETH</>
|
121 |
| - </Text> |
| 100 | + </p> |
122 | 101 | </Flex>
|
123 | 102 | </Flex>
|
124 |
| - <Box bg="background.highlight" h="full"> |
125 |
| - <Flex |
126 |
| - flexWrap="nowrap" |
127 |
| - justify="space-between" |
128 |
| - px={6} |
129 |
| - py={6} |
130 |
| - fontWeight="bold" |
131 |
| - bg="background.highlight" |
132 |
| - position="relative" |
133 |
| - > |
| 103 | + <div className="h-full bg-background-highlight"> |
| 104 | + <Flex className="relative flex-nowrap justify-between bg-background-highlight p-6 font-bold"> |
134 | 105 | {/* Amount buttons */}
|
135 | 106 | {AMOUNTS.map((amount, i) => (
|
136 | 107 | <Button
|
137 | 108 | key={i}
|
138 | 109 | onClick={() => handleSelection(amount)}
|
139 |
| - borderRadius="10px" |
140 |
| - bg={amount === chosenAmount ? "primary.hover" : "primary.base"} |
141 |
| - fontWeight="bold" |
142 |
| - textTransform="uppercase" |
143 |
| - fontSize="sm" |
| 110 | + className={cn( |
| 111 | + "rounded-[10px] text-sm font-bold uppercase", |
| 112 | + amount === chosenAmount ? "bg-primary-hover" : "bg-primary" |
| 113 | + )} |
144 | 114 | >
|
145 | 115 | {formatButtonLabel(amount)}
|
146 | 116 | </Button>
|
147 | 117 | ))}
|
148 | 118 | </Flex>
|
149 |
| - </Box> |
150 |
| - </Box> |
| 119 | + </div> |
| 120 | + </div> |
151 | 121 | )
|
152 | 122 | }
|
0 commit comments