Skip to content

Commit 9a12c5d

Browse files
feat(Simulator/screens/SendEther): migrate to Tailwind
1 parent 7908019 commit 9a12c5d

File tree

1 file changed

+34
-64
lines changed

1 file changed

+34
-64
lines changed
Lines changed: 34 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
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"
37

48
import { EthTokenIcon } from "../../icons"
59
import { NotificationPopover } from "../../NotificationPopover"
@@ -52,101 +56,67 @@ export const SendEther = ({
5256
}).format(chosenAmount)
5357

5458
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">
7665
{/* Left side: Displayed send amount */}
7766
<NotificationPopover
7867
title="Example walkthrough"
7968
content="Choose a value below"
8069
side="top"
8170
>
8271
<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+
)}
8776
>
88-
<Text fontSize="6xl" h="full" lineHeight="1em">
77+
<p className="h-full text-6xl leading-[1em]">
8978
{formatChosenAmount}
90-
</Text>
79+
</p>
9180
</Flex>
9281
</NotificationPopover>
9382
{/* Right side */}
94-
<Flex direction="column" alignItems="end">
83+
<Flex className="flex-col items-end">
9584
<NotificationPopover
9685
side="top"
9786
title="Example walkthrough"
9887
content="In this walkthrough you can only send ETH, but in real wallet you can send different tokens as well"
9988
>
10089
{/* 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>
11495
</NotificationPopover>
11596
{/* 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>
12099
<>{ethAmount} ETH</>
121-
</Text>
100+
</p>
122101
</Flex>
123102
</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">
134105
{/* Amount buttons */}
135106
{AMOUNTS.map((amount, i) => (
136107
<Button
137108
key={i}
138109
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+
)}
144114
>
145115
{formatButtonLabel(amount)}
146116
</Button>
147117
))}
148118
</Flex>
149-
</Box>
150-
</Box>
119+
</div>
120+
</div>
151121
)
152122
}

0 commit comments

Comments
 (0)