Files
web/apps/scandic-web/components/Header/MainMenu/LogoLink/index.tsx
Erik Tiekstra 0e11a772f1 feat(BOOK-450): Adjust Scandic logo in header when on a themed hotel page
Approved-by: Chuma Mcphoy (We Ahead)
2025-11-05 10:29:24 +00:00

44 lines
1.0 KiB
TypeScript

"use client"
import NextLink from "next/link"
import { useIntl } from "react-intl"
import ScandicLogoIcon from "@scandic-hotels/design-system/Icons/ScandicLogoIcon"
import useDropdownStore from "@/stores/main-menu"
import useLang from "@/hooks/useLang"
import styles from "./logoLink.module.css"
import { DropdownTypeEnum } from "@/types/components/dropdown/dropdown"
export function LogoLink() {
const lang = useLang()
const intl = useIntl()
const { toggleDropdown, isHamburgerMenuOpen } = useDropdownStore()
function handleNavigate() {
if (isHamburgerMenuOpen) {
toggleDropdown(DropdownTypeEnum.HamburgerMenu)
}
}
return (
<NextLink
className={styles.logoLink}
href={`/${lang}`}
onClick={handleNavigate}
aria-label={intl.formatMessage({
id: "header.backToScandicHotelsCom",
defaultMessage: "Back to scandichotels.com",
})}
>
<ScandicLogoIcon
className={styles.logoIcon}
width="103px"
height="22px"
/>
</NextLink>
)
}