@@ -4,7 +4,6 @@ import Link from 'next/link'
44import { usePathname } from 'next/navigation'
55import { Fragment , useReducer } from 'react'
66
7- import { URL_PREFIX } from '../../../constants'
87import { MenuItemProps } from './MenuItem'
98
109export function OpenMenuItem ( {
@@ -14,9 +13,7 @@ export function OpenMenuItem({
1413 Required < Pick < MenuItemProps , 'subMenu' > > ) {
1514 const path = usePathname ( )
1615 const selected = subMenu . some ( ( item ) =>
17- item . to
18- ? path . startsWith ( URL_PREFIX + item . to ) || path . startsWith ( item . to )
19- : false ,
16+ item . to ? path . startsWith ( item . to ) : false ,
2017 )
2118 const [ open , handleOpen ] = useReducer ( ( state ) => ! state , selected )
2219 return (
@@ -45,7 +42,7 @@ export function OpenMenuItem({
4542 { subMenu && (
4643 < Image
4744 boxSize = "16px"
48- src = { URL_PREFIX + ' /menu-arrow.svg' }
45+ src = " /menu-arrow.svg"
4946 transform = { open ? 'rotate(0deg)' : 'rotate(-90deg)' }
5047 transition = "transform 0.2s"
5148 />
@@ -56,9 +53,7 @@ export function OpenMenuItem({
5653 < Box borderRight = "1px solid var(--border, #E0E0E0)" w = "10px" />
5754 < VStack flex = "1" gap = "4px" >
5855 { subMenu . map ( ( { children, to } , idx ) => {
59- const selected = to
60- ? path . startsWith ( to ) || path . startsWith ( URL_PREFIX + to )
61- : false
56+ const selected = to ? path . startsWith ( to ) : false
6257 const inner = (
6358 < Flex
6459 _hover = { {
@@ -90,7 +85,7 @@ export function OpenMenuItem({
9085 className = { css ( {
9186 textDecoration : 'none' ,
9287 } ) }
93- href = { URL_PREFIX + to }
88+ href = { to }
9489 >
9590 { inner }
9691 </ Link >
0 commit comments