fix(BOOK-325): Added refetch options to user.name query and refactored header
Approved-by: Linus Flood Approved-by: Matilda Landström
This commit is contained in:
+40
-25
@@ -1,9 +1,11 @@
|
||||
"use client"
|
||||
|
||||
import { cx } from "class-variance-authority"
|
||||
import NextLink from "next/link"
|
||||
import { useRef } from "react"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import Link from "@scandic-hotels/design-system/OldDSLink"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
|
||||
import useDropdownStore from "@/stores/main-menu"
|
||||
|
||||
@@ -46,29 +48,40 @@ export default function MenuItem({ item, isMobile }: NavigationMenuItemProps) {
|
||||
return (
|
||||
<>
|
||||
<MainMenuButton
|
||||
onClick={() => toggleMegaMenu(megaMenuTitle)}
|
||||
className={`${styles.navigationMenuItem} ${isMobile ? styles.mobile : ""}`}
|
||||
onPress={() => toggleMegaMenu(megaMenuTitle)}
|
||||
className={styles.navigationMenuItem}
|
||||
>
|
||||
{title}
|
||||
{isMobile ? (
|
||||
<MaterialIcon
|
||||
icon="arrow_forward_ios"
|
||||
size={20}
|
||||
className={`${styles.chevron}`}
|
||||
color="CurrentColor"
|
||||
/>
|
||||
<>
|
||||
<Typography variant="Title/Subtitle/lg">
|
||||
<span>{title}</span>
|
||||
</Typography>
|
||||
<MaterialIcon
|
||||
icon="arrow_forward_ios"
|
||||
size={20}
|
||||
className={styles.chevron}
|
||||
color="CurrentColor"
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
<MaterialIcon
|
||||
icon="keyboard_arrow_down"
|
||||
size={20}
|
||||
className={`${styles.chevron} ${isMegaMenuOpen ? styles.isExpanded : ""}`}
|
||||
color="CurrentColor"
|
||||
/>
|
||||
<>
|
||||
<span>{title}</span>
|
||||
<MaterialIcon
|
||||
icon="keyboard_arrow_down"
|
||||
size={20}
|
||||
className={cx(styles.chevron, {
|
||||
[styles.isExpanded]: isMegaMenuOpen,
|
||||
})}
|
||||
color="CurrentColor"
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</MainMenuButton>
|
||||
<div
|
||||
ref={megaMenuRef}
|
||||
className={`${styles.dropdown} ${isMegaMenuOpen ? styles.isExpanded : ""}`}
|
||||
className={cx(styles.dropdown, {
|
||||
[styles.isExpanded]: isMegaMenuOpen,
|
||||
})}
|
||||
>
|
||||
<MegaMenu
|
||||
isMobile={isMobile}
|
||||
@@ -83,15 +96,17 @@ export default function MenuItem({ item, isMobile }: NavigationMenuItemProps) {
|
||||
)
|
||||
} else if (link?.url) {
|
||||
return (
|
||||
<Link
|
||||
className={`${styles.navigationMenuItem} ${isMobile ? styles.mobile : ""}`}
|
||||
variant="navigation"
|
||||
weight="bold"
|
||||
onClick={handleNavigate}
|
||||
href={link.url}
|
||||
<Typography
|
||||
variant={isMobile ? "Title/Subtitle/lg" : "Body/Paragraph/mdBold"}
|
||||
>
|
||||
{title}
|
||||
</Link>
|
||||
<NextLink
|
||||
className={cx(styles.navigationMenuItem, styles.link)}
|
||||
onClick={handleNavigate}
|
||||
href={link.url}
|
||||
>
|
||||
{title}
|
||||
</NextLink>
|
||||
</Typography>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user