feat(SW-186): implement cms data into new header
This commit is contained in:
@@ -12,14 +12,18 @@ import styles from "./navigationMenuItem.module.css"
|
||||
import type { NavigationMenuItemProps } from "@/types/components/header/navigationMenuItem"
|
||||
|
||||
export default function MenuItem({ item, isMobile }: NavigationMenuItemProps) {
|
||||
const { children, title, href, seeAllLinkText, infoCard } = item
|
||||
const { submenu, title, link, seeAllLink, card } = item
|
||||
const [isExpanded, setIsExpanded] = useState(false)
|
||||
|
||||
function handleButtonClick() {
|
||||
setIsExpanded((prev) => !prev)
|
||||
}
|
||||
|
||||
return children?.length ? (
|
||||
if (!submenu.length && !link) {
|
||||
return null
|
||||
}
|
||||
|
||||
return submenu.length ? (
|
||||
<MainMenuButton
|
||||
onClick={handleButtonClick}
|
||||
className={`${styles.navigationMenuItem} ${isMobile ? styles.mobile : styles.desktop}`}
|
||||
@@ -36,7 +40,7 @@ export default function MenuItem({ item, isMobile }: NavigationMenuItemProps) {
|
||||
</MainMenuButton>
|
||||
) : (
|
||||
<Link
|
||||
href={href}
|
||||
href={link!.href}
|
||||
color="burgundy"
|
||||
className={`${styles.navigationMenuItem} ${isMobile ? styles.mobile : styles.desktop}`}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user