|
1 | 1 | 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" |
3 | 6 |
|
4 | 7 | import { ETH_TRANSFER_FEE } from "../../constants"
|
5 | 8 | import { getMaxFractionDigitsUsd } from "../../utils"
|
@@ -29,77 +32,52 @@ export const SendSummary = ({
|
29 | 32 | return (
|
30 | 33 | <>
|
31 | 34 | {/* 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"> |
38 | 37 | You are sending
|
39 |
| - </Text> |
| 38 | + </p> |
40 | 39 | <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 | + )} |
46 | 44 | >
|
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"> |
53 | 46 | {formatChosenAmount}
|
54 |
| - </Text> |
| 47 | + </p> |
55 | 48 | </Flex>
|
56 |
| - <Text fontSize="xs" color="body.medium" m={0}> |
| 49 | + <p className="text-xs text-body-medium"> |
57 | 50 | {formatEth(chosenAmount / ethPrice)} ETH
|
58 |
| - </Text> |
59 |
| - </Box> |
| 51 | + </p> |
| 52 | + </div> |
60 | 53 | {/* 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"> |
82 | 66 | {Intl.NumberFormat("en", {
|
83 | 67 | maximumFractionDigits: getMaxFractionDigitsUsd(usdFee),
|
84 | 68 | style: "currency",
|
85 | 69 | currency: "USD",
|
86 | 70 | notation: "compact",
|
87 | 71 | }).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"> |
95 | 73 | (
|
96 | 74 | {Intl.NumberFormat("en", {
|
97 | 75 | maximumFractionDigits: 6,
|
98 | 76 | }).format(ETH_TRANSFER_FEE)}{" "}
|
99 | 77 | ETH)
|
100 |
| - </Text> |
101 |
| - </Text> |
102 |
| - </Box> |
| 78 | + </span> |
| 79 | + </p> |
| 80 | + </div> |
103 | 81 | </Flex>
|
104 | 82 | </>
|
105 | 83 | )
|
|
0 commit comments