Skip to content

Commit 2b7ecea

Browse files
feat(Simulator/WalletHome/CategoryTabs): migrate to Tailwind
1 parent 97594f2 commit 2b7ecea

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed
Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from "react"
2-
import { Flex, type FlexProps, Text } from "@chakra-ui/react"
1+
import { Button } from "@/components/ui/buttons/Button"
2+
import { Flex, type FlexProps } from "@/components/ui/flex"
33

4-
import { Button } from "../../Buttons"
4+
import { cn } from "@/lib/utils/cn"
55

66
type CategoryTabsProps = FlexProps & {
77
categories: Array<string>
@@ -12,31 +12,32 @@ export const CategoryTabs = ({
1212
categories,
1313
activeIndex = 0,
1414
setActiveIndex,
15+
className,
1516
...flexProps
1617
}: CategoryTabsProps) => (
17-
<Flex gap={6} {...flexProps}>
18-
{categories.map((category, index) =>
19-
setActiveIndex ? (
18+
<Flex className={cn("gap-6", className)} {...flexProps}>
19+
{categories.map((category, index) => {
20+
const isActiveIndex = activeIndex === index
21+
const fontWeightClass = isActiveIndex && "font-bold"
22+
return setActiveIndex ? (
2023
<Button
2124
key={category}
2225
variant="ghost"
23-
fontWeight={activeIndex === index ? "bold" : "normal"}
26+
className={cn(
27+
fontWeightClass,
28+
"p-0 pb-2 text-body",
29+
isActiveIndex && "!text-[initial]"
30+
)}
31+
disabled={isActiveIndex}
2432
onClick={() => setActiveIndex(index)}
25-
p={0}
26-
pb={2}
27-
color="body.base"
2833
>
2934
{category}
3035
</Button>
3136
) : (
32-
<Text
33-
mb={2}
34-
key={category}
35-
fontWeight={activeIndex === index ? "bold" : "normal"}
36-
>
37+
<p className={cn(fontWeightClass, "mb-2")} key={category}>
3738
{category}
38-
</Text>
39+
</p>
3940
)
40-
)}
41+
})}
4142
</Flex>
4243
)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const SendFromContacts = ({
4545
<CategoryTabs
4646
categories={["My contacts", "Recent"]}
4747
activeIndex={1}
48-
mb={4}
48+
className="mb-4"
4949
/>
5050
<Stack className="gap-4">
5151
{CONTACTS.map(({ name, lastAction }, i) => (

0 commit comments

Comments
 (0)