Skip to content

Commit fa69eaf

Browse files
committed
migrate ItemContent
1 parent d4f5ef4 commit fa69eaf

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/components/Nav/Menu/ItemContent.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { useRouter } from "next/router"
2-
import { Box, Text } from "@chakra-ui/react"
32

3+
import { cn } from "@/lib/utils/cn"
44
import { cleanPath } from "@/lib/utils/url"
55

66
import type { Level, NavItem } from "../types"
77

8-
import { useNavMenuColors } from "@/hooks/useNavMenuColors"
8+
import { useNavMenuColorsTw } from "@/hooks/useNavMenuColorsTw"
99

1010
type ItemProps = {
1111
item: NavItem
@@ -15,23 +15,23 @@ type ItemProps = {
1515
const ItemContent = ({ item, lvl }: ItemProps) => {
1616
const { label, description, ...action } = item
1717
const { asPath } = useRouter()
18-
const menuColors = useNavMenuColors()
18+
const menuColors = useNavMenuColorsTw()
1919

2020
const isLink = "href" in action
2121
const isActivePage = isLink && cleanPath(asPath) === action.href
2222

2323
return (
24-
<Box me="auto" textAlign="start" position="relative">
25-
<Text fontWeight="bold" color={menuColors.body}>
26-
{label}
27-
</Text>
28-
<Text
29-
fontSize="sm"
30-
color={isActivePage ? menuColors.body : menuColors.lvl[lvl].subtext}
24+
<div className="relative me-auto text-start">
25+
<p className={cn("font-bold text-body", menuColors.body)}>{label}</p>
26+
<p
27+
className={cn(
28+
"text-sm",
29+
isActivePage ? menuColors.body : menuColors.lvl[lvl].subtext
30+
)}
3131
>
3232
{description}
33-
</Text>
34-
</Box>
33+
</p>
34+
</div>
3535
)
3636
}
3737

0 commit comments

Comments
 (0)