Skip to content

Commit 824cb60

Browse files
feat(Simulator/screens/SendSummary): migrate to Tailwind
1 parent 14b6004 commit 824cb60

File tree

1 file changed

+32
-54
lines changed

1 file changed

+32
-54
lines changed

src/components/Simulator/screens/SendReceive/SendSummary.tsx

Lines changed: 32 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import React from "react"
2-
import { Box, Flex, Text } from "@chakra-ui/react"
2+
3+
import { Flex } from "@/components/ui/flex"
4+
5+
import { cn } from "@/lib/utils/cn"
36

47
import { ETH_TRANSFER_FEE } from "../../constants"
58
import { getMaxFractionDigitsUsd } from "../../utils"
@@ -29,77 +32,52 @@ export const SendSummary = ({
2932
return (
3033
<>
3134
{/* Top section */}
32-
<Box py={{ base: 6, md: 8 }} px={6}>
33-
<Text
34-
fontSize={{ base: "xl", md: "2xl" }}
35-
fontWeight="bold"
36-
mb={{ base: 4, md: 8 }}
37-
>
35+
<div className="px-6 py-6 md:py-8">
36+
<p className="mb-4 text-xl font-bold md:mb-8 md:text-2xl">
3837
You are sending
39-
</Text>
38+
</p>
4039
<Flex
41-
alignItems="top"
42-
flex={1}
43-
fontWeight="bold"
44-
color={chosenAmount > 0 ? "body.base" : "inherit"}
45-
mb={{ base: 0, md: 2 }}
40+
className={cn(
41+
"flex-1 font-bold md:mb-2",
42+
chosenAmount > 0 ? "text-body" : "text-inherit"
43+
)}
4644
>
47-
<Text
48-
fontSize={{ base: "5xl", md: "6xl" }}
49-
h="full"
50-
lineHeight="1em"
51-
m={0}
52-
>
45+
<p className="h-full text-5xl leading-[1em] md:text-6xl">
5346
{formatChosenAmount}
54-
</Text>
47+
</p>
5548
</Flex>
56-
<Text fontSize="xs" color="body.medium" m={0}>
49+
<p className="text-xs text-body-medium">
5750
{formatEth(chosenAmount / ethPrice)} ETH
58-
</Text>
59-
</Box>
51+
</p>
52+
</div>
6053
{/* Bottom section */}
61-
<Flex
62-
py={{ base: 4, md: 8 }}
63-
px={6}
64-
bg="background.highlight"
65-
h="full"
66-
gap={{ base: 3, md: 6 }}
67-
direction="column"
68-
sx={{ p: { m: 0 } }}
69-
fontSize={{ base: "sm", md: "md" }}
70-
>
71-
<Box>
72-
<Text>To</Text>
73-
<Text fontWeight="bold">{recipient}</Text>
74-
</Box>
75-
<Box>
76-
<Text>Arrival time</Text>
77-
<Text fontWeight="bold">est. about 12 seconds</Text>
78-
</Box>
79-
<Box>
80-
<Text>Network fees</Text>
81-
<Text m={0} fontWeight="bold">
54+
<Flex className="h-full flex-col gap-3 bg-background-highlight px-6 py-4 text-sm md:gap-6 md:py-8 md:text-md">
55+
<div>
56+
<p>To</p>
57+
<p className="font-bold">{recipient}</p>
58+
</div>
59+
<div>
60+
<p>Arrival time</p>
61+
<p className="font-bold">est. about 12 seconds</p>
62+
</div>
63+
<div>
64+
<p>Network fees</p>
65+
<p className="font-bold">
8266
{Intl.NumberFormat("en", {
8367
maximumFractionDigits: getMaxFractionDigitsUsd(usdFee),
8468
style: "currency",
8569
currency: "USD",
8670
notation: "compact",
8771
}).format(usdFee)}
88-
<Text
89-
as="span"
90-
color="body.medium"
91-
fontSize="xs"
92-
fontWeight="normal"
93-
ms={2}
94-
>
72+
<span className="ms-2 text-xs font-normal text-body-medium">
9573
(
9674
{Intl.NumberFormat("en", {
9775
maximumFractionDigits: 6,
9876
}).format(ETH_TRANSFER_FEE)}{" "}
9977
ETH)
100-
</Text>
101-
</Text>
102-
</Box>
78+
</span>
79+
</p>
80+
</div>
10381
</Flex>
10482
</>
10583
)

0 commit comments

Comments
 (0)