Skip to content

Commit 31a0190

Browse files
committed
chore: remove redundant condition
1 parent b8bd57d commit 31a0190

File tree

1 file changed

+26
-32
lines changed

1 file changed

+26
-32
lines changed

src/components/Nav/Menu/index.tsx

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import * as NavigationMenu from "@radix-ui/react-navigation-menu"
44

55
import { Button } from "@/components/Buttons"
66

7-
import { isMobile } from "@/lib/utils/isMobile"
8-
97
import { MAIN_NAV_ID, NAV_PY, SECTION_LABELS } from "@/lib/constants"
108

119
import type { NavSections } from "../types"
@@ -28,8 +26,6 @@ const Menu = ({ sections, ...props }: NavMenuProps) => {
2826
onClose,
2927
} = useNavMenu(sections)
3028

31-
const isDesktop = !isMobile()
32-
3329
return (
3430
<Box {...props}>
3531
<NavigationMenu.Root
@@ -85,34 +81,32 @@ const Menu = ({ sections, ...props }: NavMenuProps) => {
8581

8682
{/* avoid rendering desktop menu on mobile */}
8783
{/* Desktop Menu content */}
88-
{isDesktop && (
89-
<NavigationMenu.Content asChild>
90-
{/**
91-
* This is the CONTAINER for all three menu levels
92-
* This renders inside the NavigationMenu.Viewport component
93-
*/}
94-
<Box
95-
as={motion.div}
96-
variants={containerVariants}
97-
initial={false}
98-
animate={isOpen ? "open" : "closed"}
99-
position="absolute"
100-
top="19"
101-
insetInline="0"
102-
shadow="md"
103-
border="1px"
104-
borderColor={menuColors.stroke}
105-
bg={menuColors.lvl[1].background}
106-
>
107-
<SubMenu
108-
lvl={1}
109-
items={items}
110-
activeSection={activeSection}
111-
onClose={onClose}
112-
/>
113-
</Box>
114-
</NavigationMenu.Content>
115-
)}
84+
<NavigationMenu.Content asChild>
85+
{/**
86+
* This is the CONTAINER for all three menu levels
87+
* This renders inside the NavigationMenu.Viewport component
88+
*/}
89+
<Box
90+
as={motion.div}
91+
variants={containerVariants}
92+
initial={false}
93+
animate={isOpen ? "open" : "closed"}
94+
position="absolute"
95+
top="19"
96+
insetInline="0"
97+
shadow="md"
98+
border="1px"
99+
borderColor={menuColors.stroke}
100+
bg={menuColors.lvl[1].background}
101+
>
102+
<SubMenu
103+
lvl={1}
104+
items={items}
105+
activeSection={activeSection}
106+
onClose={onClose}
107+
/>
108+
</Box>
109+
</NavigationMenu.Content>
116110
</NavigationMenu.Item>
117111
)
118112
})}

0 commit comments

Comments
 (0)