Files
web/apps/scandic-web/components/Header/MainMenu/LogoLink/index.tsx
2025-07-04 11:40:09 +00:00

39 lines
946 B
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({
defaultMessage: "Back to scandichotels.com",
})}
>
<ScandicLogoIcon width="103px" height="22px" />
</NextLink>
)
}