diff --git a/apps/scandic-web/components/Header/HeaderLink/headerLink.module.css b/apps/scandic-web/components/Header/HeaderLink/headerLink.module.css index 894a1c443..afe78efcc 100644 --- a/apps/scandic-web/components/Header/HeaderLink/headerLink.module.css +++ b/apps/scandic-web/components/Header/HeaderLink/headerLink.module.css @@ -3,16 +3,8 @@ align-items: center; gap: var(--Space-x1); color: var(--Text-Interactive-Secondary); -} -.headerLink:hover { - color: var(--Text-Interactive-Default); -} - -.headerLink .icon * { - fill: var(--Icon-Interactive-Default); -} - -.headerLink:hover .icon * { - fill: var(--Icon-Interactive-Secondary); + &:hover { + color: var(--Text-Interactive-Default); + } } diff --git a/apps/scandic-web/components/Header/HeaderLink/index.tsx b/apps/scandic-web/components/Header/HeaderLink/index.tsx index bced2bf34..3a80feca2 100644 --- a/apps/scandic-web/components/Header/HeaderLink/index.tsx +++ b/apps/scandic-web/components/Header/HeaderLink/index.tsx @@ -1,6 +1,6 @@ "use client" -import Link from "next/link" +import NextLink from "next/link" import { IconByIconName } from "@scandic-hotels/design-system/Icons/IconByIconName" import { Typography } from "@scandic-hotels/design-system/Typography" @@ -14,11 +14,11 @@ export default function HeaderLink({ href, iconName, iconSize = 20, - onClick = () => undefined, + onClick, }: HeaderLinkProps) { return ( - + {iconName ? ( ) : null} {children} - + ) } diff --git a/apps/scandic-web/components/Header/MainMenu/MainMenuButton/index.tsx b/apps/scandic-web/components/Header/MainMenu/MainMenuButton/index.tsx index b5b3ae55a..3d95fb7b2 100644 --- a/apps/scandic-web/components/Header/MainMenu/MainMenuButton/index.tsx +++ b/apps/scandic-web/components/Header/MainMenu/MainMenuButton/index.tsx @@ -1,16 +1,30 @@ +import { cx } from "class-variance-authority" +import { Button as ButtonRAC } from "react-aria-components" + +import { Typography } from "@scandic-hotels/design-system/Typography" + import styles from "./menuButton.module.css" -import type { MainMenuButtonProps } from "@/types/components/header/mainMenuButton" +import type { ComponentProps } from "react" + +interface MainMenuButtonProps extends ComponentProps { + isLoading?: boolean +} export default function MainMenuButton({ - className = "", + className, + isLoading, ...props }: MainMenuButtonProps) { return ( - + toggleDropdown(DropdownTypeEnum.HamburgerMenu)} + onClick={handleLinkClick} > {intl.formatMessage({ id: "booking.findBooking", defaultMessage: "Find booking", })} - + {intl.formatMessage({ id: "common.customerService", diff --git a/apps/scandic-web/components/Header/MainMenu/MobileMenu/mobileMenu.module.css b/apps/scandic-web/components/Header/MainMenu/MobileMenu/mobileMenu.module.css index 0f42cabba..21b6d03c3 100644 --- a/apps/scandic-web/components/Header/MainMenu/MobileMenu/mobileMenu.module.css +++ b/apps/scandic-web/components/Header/MainMenu/MobileMenu/mobileMenu.module.css @@ -1,13 +1,3 @@ -@keyframes slide-in { - from { - right: -100vw; - } - - to { - right: 0; - } -} - .hamburger { background-color: transparent; border: none; @@ -20,7 +10,7 @@ .bar, .bar::after, .bar::before { - background: var(--Base-Text-High-contrast); + background: var(--Icon-Interactive-Default); border-radius: 2.3px; display: block; height: 3px; @@ -70,7 +60,7 @@ right: auto; bottom: 0; width: 100%; - background-color: var(--Base-Surface-Primary-light-Normal); + background-color: var(--Surface-Primary-Default); transition: right 0.3s; z-index: var(--menu-overlay-z-index); } @@ -90,7 +80,7 @@ } .footer { - background-color: var(--Base-Surface-Subtle-Normal); + background-color: var(--Surface-Secondary-Default); padding: var(--Space-x4) var(--Space-x2); display: grid; gap: var(--Space-x2); @@ -102,3 +92,13 @@ display: none; } } + +@keyframes slide-in { + from { + right: -100vw; + } + + to { + right: 0; + } +} diff --git a/apps/scandic-web/components/Header/MainMenu/MyPagesMenu/index.tsx b/apps/scandic-web/components/Header/MainMenu/MyPagesMenu/index.tsx index d4da5fa99..6bd703654 100644 --- a/apps/scandic-web/components/Header/MainMenu/MyPagesMenu/index.tsx +++ b/apps/scandic-web/components/Header/MainMenu/MyPagesMenu/index.tsx @@ -1,10 +1,10 @@ "use client" +import { cx } from "class-variance-authority" import { useRef } from "react" import { useIntl } from "react-intl" import { Avatar } from "@scandic-hotels/design-system/Avatar" -import Body from "@scandic-hotels/design-system/Body" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import SkeletonShimmer from "@scandic-hotels/design-system/SkeletonShimmer" @@ -56,24 +56,24 @@ export default function MyPagesMenu({ return (
toggleDropdown(DropdownTypeEnum.MyPagesMenu)} + onPress={() => toggleDropdown(DropdownTypeEnum.MyPagesMenu)} > - - - {intl.formatMessage( - { - id: "myPages.hiFirstName", - defaultMessage: "Hi {firstName}!", - }, - { firstName: user.firstName } - )} - - + + {intl.formatMessage( + { + id: "myPages.hiFirstName", + defaultMessage: "Hi {firstName}!", + }, + { firstName: user.firstName } + )} + @@ -96,7 +96,7 @@ export default function MyPagesMenu({ export function MyPagesMenuSkeleton() { return (
- + ) @@ -100,22 +101,11 @@ function PrimaryLinks({ return (
    - {primaryLinks.map((link, i) => ( -
  • - - {link.text} - - + {primaryLinks.map(({ text, href }) => ( +
  • + + {text} +
  • ))}
@@ -135,35 +125,20 @@ function SecondaryLinks({ return (
    - {secondaryLinks.map((link, i) => ( -
  • - - {link.text} - - + {secondaryLinks.map(({ text, href }) => ( +
  • + + {text} +
  • ))}
  • - + {intl.formatMessage({ id: "common.logOut", defaultMessage: "Log out", })} - +
) diff --git a/apps/scandic-web/components/Header/MainMenu/MyPagesMenuContent/myPagesMenuContent.module.css b/apps/scandic-web/components/Header/MainMenu/MyPagesMenuContent/myPagesMenuContent.module.css index 3b7f11d5c..8d4c09655 100644 --- a/apps/scandic-web/components/Header/MainMenu/MyPagesMenuContent/myPagesMenuContent.module.css +++ b/apps/scandic-web/components/Header/MainMenu/MyPagesMenuContent/myPagesMenuContent.module.css @@ -6,44 +6,29 @@ padding: 0 var(--Space-x1); } -.myPagesMenuContent .friendTypeWrapper { - color: var(--UI-Text-Medium-contrast); +.friendTypeWrapper { + color: var(--Text-Secondary); } .divider { margin: var(--Space-x2) 0; } -.friendType { - font-family: var(--typography-Title-5-fontFamily); - letter-spacing: var(--typography-Title-5-letterSpacing); - font-size: var(--typography-Caption-Bold-fontSize); - text-transform: uppercase; -} - .friendType::after { content: " ยท "; display: inline; padding: 0 var(--Space-x05); } -.groups, .menuItems { list-style: none; } -.link:not(:hover) .arrow { - opacity: 0; -} - -.arrow { - flex-shrink: 0; -} - @media screen and (min-width: 768px) { .myPagesMenuContent { padding: var(--Space-x2) var(--Space-x4); } + .intro.noMembership, .userName { display: none; diff --git a/apps/scandic-web/components/Header/MainMenu/MyPagesMenuWrapper/index.tsx b/apps/scandic-web/components/Header/MainMenu/MyPagesMenuWrapper/index.tsx index 2db375085..84c216440 100644 --- a/apps/scandic-web/components/Header/MainMenu/MyPagesMenuWrapper/index.tsx +++ b/apps/scandic-web/components/Header/MainMenu/MyPagesMenuWrapper/index.tsx @@ -28,7 +28,13 @@ export default function MyPagesMenuWrapper() { const { data: session } = useSession() const isUserLoggedIn = isValidSession(session) - const { data: user, isLoading: isLoadingUser } = trpc.user.name.useQuery() + const { data: user, isLoading: isLoadingUser } = trpc.user.name.useQuery( + undefined, + { + refetchOnWindowFocus: true, + refetchInterval: 300_000, + } + ) const { data: membership, isLoading: isLoadingMembership } = trpc.user.safeMembershipLevel.useQuery() diff --git a/apps/scandic-web/components/Header/MainMenu/MyPagesMobileMenu/index.tsx b/apps/scandic-web/components/Header/MainMenu/MyPagesMobileMenu/index.tsx index 300a6ad32..ece810191 100644 --- a/apps/scandic-web/components/Header/MainMenu/MyPagesMobileMenu/index.tsx +++ b/apps/scandic-web/components/Header/MainMenu/MyPagesMobileMenu/index.tsx @@ -51,8 +51,7 @@ export default function MyPagesMobileMenu({ return (
toggleDropdown(DropdownTypeEnum.MyPagesMobileMenu)} + onPress={() => toggleDropdown(DropdownTypeEnum.MyPagesMobileMenu)} aria-label={intl.formatMessage({ id: "header.openMyPagesMenu", defaultMessage: "Open my pages menu", @@ -85,7 +84,7 @@ export default function MyPagesMobileMenu({ export function MyPagesMobileMenuSkeleton() { return (
- +
diff --git a/apps/scandic-web/components/Header/MainMenu/MyPagesMobileMenu/myPagesMobileMenu.module.css b/apps/scandic-web/components/Header/MainMenu/MyPagesMobileMenu/myPagesMobileMenu.module.css index bb9704d3a..868200d4a 100644 --- a/apps/scandic-web/components/Header/MainMenu/MyPagesMobileMenu/myPagesMobileMenu.module.css +++ b/apps/scandic-web/components/Header/MainMenu/MyPagesMobileMenu/myPagesMobileMenu.module.css @@ -1,13 +1,3 @@ -@keyframes slide-in { - from { - right: -100vw; - } - - to { - right: 0; - } -} - .modal { position: fixed; top: calc(var(--main-menu-mobile-height) + var(--alert-and-banner-height)); @@ -16,13 +6,14 @@ width: 100%; background-color: var(--Base-Surface-Primary-light-Normal); z-index: var(--menu-overlay-z-index); -} -.modal[data-entering] { - animation: slide-in 0.3s; -} -.modal[data-exiting] { - animation: slide-in 0.3s reverse; + &[data-entering] { + animation: slide-in 0.3s; + } + + &[data-exiting] { + animation: slide-in 0.3s reverse; + } } .dialog { @@ -36,3 +27,13 @@ display: none; } } + +@keyframes slide-in { + from { + right: -100vw; + } + + to { + right: 0; + } +} diff --git a/apps/scandic-web/components/Header/MainMenu/NavigationMenu/MegaMenu/index.tsx b/apps/scandic-web/components/Header/MainMenu/NavigationMenu/MegaMenu/index.tsx index d81ad4f76..4295dfa6d 100644 --- a/apps/scandic-web/components/Header/MainMenu/NavigationMenu/MegaMenu/index.tsx +++ b/apps/scandic-web/components/Header/MainMenu/NavigationMenu/MegaMenu/index.tsx @@ -1,15 +1,19 @@ "use client" +import { cx } from "class-variance-authority" +import { Button as ButtonRAC } from "react-aria-components" import FocusLock from "react-focus-lock" +import ButtonLink from "@scandic-hotels/design-system/ButtonLink" 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" import Card from "@/components/TempDesignSystem/Card" +import { MenuLink } from "../../MenuLink" + import styles from "./megaMenu.module.css" import { DropdownTypeEnum } from "@/types/components/dropdown/dropdown" @@ -35,14 +39,13 @@ export default function MegaMenu({ return ( -