Skip to content

Commit f3424a4

Browse files
committed
refactor: migrate to tw and latest theming
1 parent 590f5d9 commit f3424a4

File tree

3 files changed

+52
-61
lines changed

3 files changed

+52
-61
lines changed
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 22 additions & 0 deletions
Loading
Lines changed: 25 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import React from "react"
21
import { PiMagnifyingGlass } from "react-icons/pi"
3-
import { Box, Button, Flex, Icon, Text } from "@chakra-ui/react"
42

5-
import { SimulatorNavProps } from "@/lib/types"
3+
import type { SimulatorNavProps } from "@/lib/types"
4+
5+
import EthTokenIconGrayscale from "@/components/Simulator/icons/eth-token-icon-grayscale.svg"
6+
import QrCodeIcon from "@/components/Simulator/icons/qr-code-icon.svg"
7+
import { Button } from "@/components/ui/buttons/Button"
8+
import { Stack } from "@/components/ui/flex"
69

7-
import { EthTokenIconGrayscale, QrCodeIcon } from "../../icons"
810
import { NotificationPopover } from "../../NotificationPopover"
911
import { CategoryTabs } from "../../WalletHome/CategoryTabs"
1012

@@ -23,85 +25,47 @@ export const SendFromContacts = ({
2325
}
2426
return (
2527
<>
26-
<Box py={8} px={6}>
27-
<Text fontSize={{ base: "xl", md: "2xl" }} fontWeight="bold" mb={8}>
28-
Choose recipient
29-
</Text>
28+
<div className="px-6 py-8">
29+
<p className="mb-8 text-xl font-bold md:text-2xl">Choose recipient</p>
3030
<NotificationPopover
3131
title="Example walkthrough"
3232
content={`Choose ${CONTACTS[0].name} from recent contacts`}
3333
>
3434
<Button
3535
variant="outline"
36-
leftIcon={<Icon as={PiMagnifyingGlass} />}
37-
rightIcon={<Icon as={QrCodeIcon} />}
38-
color="disabled"
39-
py={4}
40-
w="full"
41-
_hover={{
42-
color: "disabled",
43-
borderColor: "disabled",
44-
}}
45-
cursor="auto"
36+
className="w-full cursor-auto border-disabled py-4 text-disabled hover:!text-disabled hover:shadow-none"
4637
>
47-
<Text as="span" me="auto">
48-
Address or contacts
49-
</Text>
38+
<PiMagnifyingGlass />
39+
<span className="me-auto">Address or contacts</span>
40+
<QrCodeIcon className="text-lg text-disabled" />
5041
</Button>
5142
</NotificationPopover>
52-
</Box>
53-
<Box py={8} px={6} bg="background.highlight" h="full">
43+
</div>
44+
<div className="h-full bg-background-highlight px-6 py-8">
5445
<CategoryTabs
5546
categories={["My contacts", "Recent"]}
5647
activeIndex={1}
5748
mb={4}
5849
/>
59-
<Flex direction="column" gap={4}>
50+
<Stack className="gap-4">
6051
{CONTACTS.map(({ name, lastAction }, i) => (
6152
<Button
6253
key={name + i}
63-
leftIcon={
64-
<Icon
65-
as={EthTokenIconGrayscale}
66-
fill="black"
67-
w="30px"
68-
h="30px"
69-
/>
70-
}
71-
isDisabled={i > 0}
72-
gap={2}
73-
_disabled={{
74-
color: "body.base",
75-
bg: "background.base",
76-
pointerEvents: "none",
77-
}}
78-
data-group
54+
disabled={i > 0}
55+
className="group gap-2 disabled:bg-background disabled:text-body hover:[&_path]:fill-primary-hover"
7956
onClick={() => handleSelection(name)}
8057
>
81-
<Box as="span" flex={1}>
82-
<Text
83-
as="span"
84-
display="block"
85-
fontWeight="bold"
86-
textAlign="start"
87-
>
88-
{name}
89-
</Text>
90-
<Text
91-
as="span"
92-
display="block"
93-
color="body.light"
94-
textAlign="start"
95-
_groupDisabled={{ color: "body.medium" }}
96-
fontSize="sm"
97-
>
58+
<EthTokenIconGrayscale className="text-[30px]" />
59+
<span className="flex-1">
60+
<span className="block text-start font-bold">{name}</span>
61+
<span className="block text-start text-sm text-white group-disabled:text-body-medium">
9862
{lastAction}
99-
</Text>
100-
</Box>
63+
</span>
64+
</span>
10165
</Button>
10266
))}
103-
</Flex>
104-
</Box>
67+
</Stack>
68+
</div>
10569
</>
10670
)
10771
}

0 commit comments

Comments
 (0)