Merged in feat/sw-3230-move-link-to-design-system (pull request #2618)
feat(SW-3230): Move Link to design-system * Move Link to design-system * Remove comments Approved-by: Linus Flood
This commit is contained in:
@@ -7,6 +7,7 @@ import { useIntl } from "react-intl"
|
||||
import { findMyBookingCurrentWebPath } from "@scandic-hotels/common/constants/routes/findMyBooking"
|
||||
import { myPages } from "@scandic-hotels/common/constants/routes/myPages"
|
||||
import { getCurrentWebUrl } from "@scandic-hotels/common/utils/url"
|
||||
import Link from "@scandic-hotels/design-system/Link"
|
||||
import SkeletonShimmer from "@scandic-hotels/design-system/SkeletonShimmer"
|
||||
|
||||
import { logout } from "@/constants/routes/handleAuth"
|
||||
@@ -16,7 +17,6 @@ import useDropdownStore from "@/stores/main-menu"
|
||||
import Image from "@/components/Image"
|
||||
import LoginButton from "@/components/LoginButton"
|
||||
import Avatar from "@/components/MyPages/Avatar"
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
import useLang from "@/hooks/useLang"
|
||||
import { trackClick } from "@/utils/tracking"
|
||||
|
||||
@@ -81,6 +81,12 @@ export function MainMenu({
|
||||
toggleDropdown(DropdownTypeEnum.MyPagesMobileMenu)
|
||||
}
|
||||
|
||||
const trackHamburgerMenuClick = (title: string) => {
|
||||
if (isHamburgerMenuOpen) {
|
||||
trackClick(`hamburger - ${title}`)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.mainMenu}>
|
||||
<div
|
||||
@@ -177,13 +183,10 @@ export function MainMenu({
|
||||
{links.map((link, i) => (
|
||||
<li className={styles.li} key={link.href + i}>
|
||||
<Link
|
||||
id={`hamburger - ${link.title}`}
|
||||
className={styles.link}
|
||||
href={link.href}
|
||||
trackingId={
|
||||
isHamburgerMenuOpen
|
||||
? `hamburger - ${link.title}`
|
||||
: undefined
|
||||
}
|
||||
onClick={() => trackHamburgerMenuClick(link.title)}
|
||||
>
|
||||
{link.title}
|
||||
</Link>
|
||||
@@ -195,13 +198,10 @@ export function MainMenu({
|
||||
{topMenuMobileLinks.map(({ link }, i) => (
|
||||
<li className={styles.mobileLi} key={link.href + i}>
|
||||
<Link
|
||||
id={`hamburger - ${link.title}`}
|
||||
className={styles.mobileLink}
|
||||
href={link.href}
|
||||
trackingId={
|
||||
isHamburgerMenuOpen
|
||||
? `hamburger - ${link.title}`
|
||||
: undefined
|
||||
}
|
||||
onClick={() => trackHamburgerMenuClick(link.title)}
|
||||
>
|
||||
{link.title}
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user