chore: cleanup
This commit is contained in:
@@ -104,8 +104,10 @@
|
||||
--max-width-text-block: 49.5rem;
|
||||
--mobile-site-header-height: 70.047px;
|
||||
--max-width-navigation: 89.5rem;
|
||||
|
||||
--main-menu-mobile-height: 75px;
|
||||
--mobile-menu-overlay-z-index: 10;
|
||||
|
||||
--menu-overlay-z-index: 10;
|
||||
}
|
||||
|
||||
* {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.topLink {
|
||||
.headerLink {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--Spacing-x1);
|
||||
|
||||
@@ -2,11 +2,11 @@ import Link from "@/components/TempDesignSystem/Link"
|
||||
|
||||
import styles from "./headerLink.module.css"
|
||||
|
||||
import { HeaderLinkProps } from "@/types/components/header/headerLink"
|
||||
import type { HeaderLinkProps } from "@/types/components/header/headerLink"
|
||||
|
||||
export default function HeaderLink({ children, ...props }: HeaderLinkProps) {
|
||||
return (
|
||||
<Link color="burgundy" className={styles.topLink} {...props}>
|
||||
<Link color="burgundy" className={styles.headerLink} {...props}>
|
||||
{children}
|
||||
</Link>
|
||||
)
|
||||
|
||||
@@ -3,7 +3,7 @@ import Image from "@/components/Image"
|
||||
|
||||
import styles from "./avatar.module.css"
|
||||
|
||||
import { AvatarProps } from "@/types/components/header/avatar"
|
||||
import type { AvatarProps } from "@/types/components/header/avatar"
|
||||
|
||||
export default function Avatar({ image, initials }: AvatarProps) {
|
||||
let classNames = [styles.avatar]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import styles from "./menuButton.module.css"
|
||||
|
||||
import { MainMenuButtonProps } from "@/types/components/header/mainMenuButton"
|
||||
import type { MainMenuButtonProps } from "@/types/components/header/mainMenuButton"
|
||||
|
||||
export default function MainMenuButton({
|
||||
className = "",
|
||||
|
||||
@@ -14,7 +14,7 @@ import NavigationMenu from "../NavigationMenu"
|
||||
|
||||
import styles from "./mobileMenu.module.css"
|
||||
|
||||
import { MobileMenuProps } from "@/types/components/header/mobileMenu"
|
||||
import type { MobileMenuProps } from "@/types/components/header/mobileMenu"
|
||||
|
||||
export default function MobileMenu({
|
||||
mainNavigation,
|
||||
@@ -24,8 +24,10 @@ export default function MobileMenu({
|
||||
const {
|
||||
isHamburgerMenuOpen,
|
||||
isMyPagesMobileMenuOpen,
|
||||
isLanguageSwitcherOpen,
|
||||
toggleHamburgerMenu,
|
||||
toggleMyPagesMobileMenu,
|
||||
toggleLanguageSwitcher,
|
||||
} = useDropdownStore()
|
||||
|
||||
useHandleKeyUp((event: KeyboardEvent) => {
|
||||
@@ -38,6 +40,10 @@ export default function MobileMenu({
|
||||
if (isMyPagesMobileMenuOpen) {
|
||||
toggleMyPagesMobileMenu()
|
||||
} else {
|
||||
if (isLanguageSwitcherOpen) {
|
||||
toggleLanguageSwitcher()
|
||||
}
|
||||
|
||||
toggleHamburgerMenu()
|
||||
}
|
||||
}
|
||||
@@ -73,7 +79,7 @@ export default function MobileMenu({
|
||||
<ServiceIcon width={20} height={20} color="burgundy" />
|
||||
{intl.formatMessage({ id: "Customer service" })}
|
||||
</HeaderLink>
|
||||
<LanguageSwitcher variant="mobileHeader" urls={languageUrls} />
|
||||
<LanguageSwitcher type="mobileHeader" urls={languageUrls} />
|
||||
</footer>
|
||||
</Dialog>
|
||||
</Modal>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
display: inline-block;
|
||||
height: 3px;
|
||||
position: relative;
|
||||
transition: all 0.2s;
|
||||
transition: all 0.3s;
|
||||
width: 32px;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
width: 100%;
|
||||
background-color: var(--Base-Surface-Primary-light-Normal);
|
||||
transition: right 0.3s;
|
||||
z-index: var(--mobile-menu-overlay-z-index);
|
||||
z-index: var(--menu-overlay-z-index);
|
||||
}
|
||||
|
||||
.modal[data-entering] {
|
||||
|
||||
@@ -16,7 +16,7 @@ import MyPagesMenuContent from "../MyPagesMenuContent"
|
||||
|
||||
import styles from "./myPagesMenu.module.css"
|
||||
|
||||
import { MyPagesMenuProps } from "@/types/components/header/myPagesMenu"
|
||||
import type { MyPagesMenuProps } from "@/types/components/header/myPagesMenu"
|
||||
|
||||
export default function MyPagesMenu({ navigation, user }: MyPagesMenuProps) {
|
||||
const intl = useIntl()
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
.chevron {
|
||||
transition: transform 0.2s;
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
|
||||
.chevron.isExpanded {
|
||||
@@ -18,13 +18,13 @@
|
||||
|
||||
.dropdown {
|
||||
position: absolute;
|
||||
top: 46px;
|
||||
top: 2.875rem; /* 2.875rem is the height of the main menu + bottom padding */
|
||||
right: 0;
|
||||
background-color: var(--Base-Surface-Primary-light-Normal);
|
||||
border-radius: var(--Corner-radius-Large);
|
||||
box-shadow: 0px 0px 14px 6px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 0 0.875rem 0.375rem rgba(0, 0, 0, 0.1);
|
||||
min-width: 20rem;
|
||||
z-index: 1;
|
||||
z-index: var(--menu-overlay-z-index);
|
||||
}
|
||||
|
||||
/* Triangle above dropdown */
|
||||
|
||||
@@ -14,7 +14,7 @@ import { useTrapFocus } from "@/hooks/useTrapFocus"
|
||||
|
||||
import styles from "./myPagesMenuContent.module.css"
|
||||
|
||||
import { MyPagesMenuContentProps } from "@/types/components/header/myPagesMenu"
|
||||
import type { MyPagesMenuContentProps } from "@/types/components/header/myPagesMenu"
|
||||
|
||||
export default function MyPagesMenuContent({
|
||||
navigation,
|
||||
|
||||
@@ -14,7 +14,7 @@ import MyPagesMenuContent from "../MyPagesMenuContent"
|
||||
|
||||
import styles from "./myPagesMobileMenu.module.css"
|
||||
|
||||
import { MyPagesMenuProps } from "@/types/components/header/myPagesMenu"
|
||||
import type { MyPagesMenuProps } from "@/types/components/header/myPagesMenu"
|
||||
|
||||
export default function MyPagesMobileMenu({
|
||||
navigation,
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background-color: var(--Base-Surface-Primary-light-Normal);
|
||||
transition: right 0.3s;
|
||||
z-index: var(--mobile-menu-overlay-z-index);
|
||||
z-index: var(--menu-overlay-z-index);
|
||||
}
|
||||
|
||||
.modal[data-entering] {
|
||||
|
||||
@@ -10,7 +10,7 @@ import { navigationMenuItemVariants } from "./variants"
|
||||
|
||||
import styles from "./navigationMenuItem.module.css"
|
||||
|
||||
import { NavigationMenuItemProps } from "@/types/components/header/navigationMenuItem"
|
||||
import type { NavigationMenuItemProps } from "@/types/components/header/navigationMenuItem"
|
||||
|
||||
export default function MenuItem({ item, variant }: NavigationMenuItemProps) {
|
||||
const { children, title, href, seeAllLinkText, infoCard } = item
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
}
|
||||
|
||||
.chevron {
|
||||
transition: transform 0.2s;
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
|
||||
.chevron.isExpanded {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { navigationMenuVariants } from "./variants"
|
||||
|
||||
import styles from "./navigationMenu.module.css"
|
||||
|
||||
import { NavigationMenuProps } from "@/types/components/header/navigationMenu"
|
||||
import type { NavigationMenuProps } from "@/types/components/header/navigationMenu"
|
||||
|
||||
export default function NavigationMenu({
|
||||
items,
|
||||
|
||||
@@ -17,7 +17,7 @@ import NavigationMenu from "./NavigationMenu"
|
||||
|
||||
import styles from "./mainMenu.module.css"
|
||||
|
||||
import { MainMenuProps } from "@/types/components/header/mainMenu"
|
||||
import type { MainMenuProps } from "@/types/components/header/mainMenu"
|
||||
|
||||
export default async function MainMenu({ languageUrls }: MainMenuProps) {
|
||||
const intl = await getIntl()
|
||||
@@ -30,7 +30,7 @@ export default async function MainMenu({ languageUrls }: MainMenuProps) {
|
||||
return (
|
||||
<div className={styles.mainMenu}>
|
||||
<nav className={styles.nav}>
|
||||
<NextLink className={styles.logoLink} href="/">
|
||||
<NextLink className={styles.logoLink} href={`/${lang}`}>
|
||||
<Image
|
||||
alt={intl.formatMessage({ id: "Back to scandichotels.com" })}
|
||||
className={styles.logo}
|
||||
@@ -44,16 +44,10 @@ export default async function MainMenu({ languageUrls }: MainMenuProps) {
|
||||
</NextLink>
|
||||
<div className={styles.menus}>
|
||||
<NavigationMenu items={navigationMenuItems} />
|
||||
{true ? (
|
||||
{user ? (
|
||||
<>
|
||||
<MyPagesMenu
|
||||
navigation={myPagesNavigation}
|
||||
user={{ firstName: "Hubba", lastName: "Bubba" }}
|
||||
/>
|
||||
<MyPagesMobileMenu
|
||||
navigation={myPagesNavigation}
|
||||
user={{ firstName: "Hubba", lastName: "Bubba" }}
|
||||
/>
|
||||
<MyPagesMenu navigation={myPagesNavigation} user={user} />
|
||||
<MyPagesMobileMenu navigation={myPagesNavigation} user={user} />
|
||||
</>
|
||||
) : (
|
||||
<Link
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 6.4375rem;
|
||||
height: 1.375rem;
|
||||
}
|
||||
|
||||
.loginLink {
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
"use client"
|
||||
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { SearchIcon } from "@/components/Icons"
|
||||
|
||||
import styles from "./search.module.css"
|
||||
|
||||
export default function Search() {
|
||||
const intl = useIntl()
|
||||
|
||||
return (
|
||||
<button type="button" className={styles.button}>
|
||||
<SearchIcon width={20} height={20} color="burgundy" />
|
||||
{intl.formatMessage({ id: "Find booking" })}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
.button {
|
||||
background-color: transparent;
|
||||
color: var(--Base-Text-High-contrast);
|
||||
font-family: var(--typography-Caption-Regular-fontFamily);
|
||||
font-size: var(--typography-Caption-Regular-fontSize);
|
||||
border-width: 0;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
gap: var(--Spacing-x1);
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
.button {
|
||||
font-size: var(--typography-Body-Bold-fontSize);
|
||||
font-family: var(--typography-Body-Bold-fontFamily);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import HeaderLink from "../HeaderLink"
|
||||
|
||||
import styles from "./topMenu.module.css"
|
||||
|
||||
import { TopMenuProps } from "@/types/components/header/topMenu"
|
||||
import type { TopMenuProps } from "@/types/components/header/topMenu"
|
||||
|
||||
export default async function TopMenu({ languageUrls }: TopMenuProps) {
|
||||
const intl = await getIntl()
|
||||
@@ -19,7 +19,7 @@ export default async function TopMenu({ languageUrls }: TopMenuProps) {
|
||||
{intl.formatMessage({ id: "Join Scandic Friends" })}
|
||||
</HeaderLink>
|
||||
<div className={styles.right}>
|
||||
<LanguageSwitcher variant="desktopHeader" urls={languageUrls} />
|
||||
<LanguageSwitcher type="desktopHeader" urls={languageUrls} />
|
||||
<HeaderLink href="#">
|
||||
<SearchIcon width={20} height={20} color="burgundy" />
|
||||
{intl.formatMessage({ id: "Find booking" })}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
.header {
|
||||
font-family: var(--typography-Body-Regular-fontFamily);
|
||||
color: var(--Base-Text-High-contrast);
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
@@ -11,13 +11,13 @@ import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||
import useLang from "@/hooks/useLang"
|
||||
import { useTrapFocus } from "@/hooks/useTrapFocus"
|
||||
|
||||
import styles from "./languageSwitcher.module.css"
|
||||
import styles from "./languageSwitcherContent.module.css"
|
||||
|
||||
import { LanguageSwitcherProps } from "@/types/components/header/languageSwitcher"
|
||||
import type { LanguageSwitcherProps } from "@/types/components/languageSwitcher/languageSwitcher"
|
||||
|
||||
export default function LanguageSwitcherContent({
|
||||
urls,
|
||||
variant,
|
||||
type,
|
||||
}: LanguageSwitcherProps) {
|
||||
const intl = useIntl()
|
||||
const currentLanguage = useLang()
|
||||
@@ -26,8 +26,8 @@ export default function LanguageSwitcherContent({
|
||||
const urlKeys = Object.keys(urls) as Lang[]
|
||||
|
||||
return (
|
||||
<div className={styles.content} ref={languageSwitcherRef}>
|
||||
{variant === "mobileHeader" ? (
|
||||
<div className={styles.languageSwitcherContent} ref={languageSwitcherRef}>
|
||||
{type === "mobileHeader" ? (
|
||||
<div className={styles.backWrapper}>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -1,52 +1,3 @@
|
||||
@keyframes slide-in {
|
||||
from {
|
||||
right: -100vw;
|
||||
}
|
||||
|
||||
to {
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.button {
|
||||
background-color: transparent;
|
||||
color: var(--Base-Text-High-contrast);
|
||||
font-family: var(--typography-Caption-Regular-fontFamily);
|
||||
font-size: var(--typography-Caption-Regular-fontSize);
|
||||
border-width: 0;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, max-content) 1fr;
|
||||
gap: var(--Spacing-x1);
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.chevron {
|
||||
justify-self: end;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
|
||||
.chevron.isExpanded {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.dropdown {
|
||||
position: fixed;
|
||||
top: var(--main-menu-mobile-height);
|
||||
right: -100vw;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background-color: var(--Base-Surface-Primary-light-Normal);
|
||||
transition: right 0.3s;
|
||||
}
|
||||
|
||||
.dropdown.isExpanded {
|
||||
display: block;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.backWrapper {
|
||||
background-color: var(--Base-Surface-Secondary-light-Normal);
|
||||
padding: var(--Spacing-x2);
|
||||
@@ -106,10 +57,6 @@
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
.languageSwitcher {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.backWrapper,
|
||||
.backButton {
|
||||
display: none;
|
||||
@@ -123,37 +70,6 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.dropdown {
|
||||
position: absolute;
|
||||
top: 2.25rem;
|
||||
background-color: var(--Base-Surface-Primary-light-Normal);
|
||||
border-radius: var(--Corner-radius-Large);
|
||||
box-shadow: 0px 0px 14px 6px #0000001a;
|
||||
display: none;
|
||||
min-width: 12.5rem;
|
||||
z-index: 1;
|
||||
bottom: auto;
|
||||
}
|
||||
|
||||
/* Triangle above dropdown */
|
||||
.dropdown::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: -1.25rem;
|
||||
right: 2.4rem;
|
||||
transform: rotate(180deg);
|
||||
border-width: 0.75rem;
|
||||
border-style: solid;
|
||||
border-color: var(--Base-Surface-Primary-light-Normal) transparent
|
||||
transparent transparent;
|
||||
}
|
||||
|
||||
.button {
|
||||
grid-template-columns: repeat(3, max-content);
|
||||
font-size: var(--typography-Body-Bold-fontSize);
|
||||
font-family: var(--typography-Body-Bold-fontFamily);
|
||||
}
|
||||
|
||||
.link.active:not(:hover) {
|
||||
background-color: transparent;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import { cva } from "class-variance-authority"
|
||||
|
||||
import styles from "./languageSwitcher.module.css"
|
||||
|
||||
export const languageSwitcherContentVariants = cva(styles.languageSwitcher, {
|
||||
variants: {
|
||||
variant: {
|
||||
mobileHeader: styles.mobileHeader,
|
||||
mobileFooter: styles.mobileFooter,
|
||||
desktopHeader: styles.desktopHeader,
|
||||
desktopFooter: styles.desktopFooter,
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: "desktopHeader",
|
||||
},
|
||||
})
|
||||
@@ -13,11 +13,11 @@ import LanguageSwitcherContent from "./LanguageSwitcherContent"
|
||||
|
||||
import styles from "./languageSwitcher.module.css"
|
||||
|
||||
import { LanguageSwitcherProps } from "@/types/components/header/languageSwitcher"
|
||||
import type { LanguageSwitcherProps } from "@/types/components/languageSwitcher/languageSwitcher"
|
||||
|
||||
export default function LanguageSwitcher({
|
||||
urls,
|
||||
variant,
|
||||
type,
|
||||
}: LanguageSwitcherProps) {
|
||||
const intl = useIntl()
|
||||
const currentLanguage = useLang()
|
||||
@@ -55,7 +55,7 @@ export default function LanguageSwitcher({
|
||||
className={`${styles.dropdown} ${isLanguageSwitcherOpen ? styles.isExpanded : ""}`}
|
||||
>
|
||||
{isLanguageSwitcherOpen ? (
|
||||
<LanguageSwitcherContent urls={urls} variant={variant} />
|
||||
<LanguageSwitcherContent urls={urls} type={type} />
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
@keyframes slide-in {
|
||||
from {
|
||||
right: -100vw;
|
||||
}
|
||||
|
||||
to {
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.button {
|
||||
background-color: transparent;
|
||||
color: var(--Base-Text-High-contrast);
|
||||
@@ -25,7 +15,7 @@
|
||||
|
||||
.chevron {
|
||||
justify-self: end;
|
||||
transition: transform 0.2s;
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
|
||||
.chevron.isExpanded {
|
||||
@@ -40,6 +30,7 @@
|
||||
width: 100%;
|
||||
background-color: var(--Base-Surface-Primary-light-Normal);
|
||||
transition: right 0.3s;
|
||||
z-index: var(--menu-overlay-z-index);
|
||||
}
|
||||
|
||||
.dropdown.isExpanded {
|
||||
@@ -47,82 +38,11 @@
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.backWrapper {
|
||||
background-color: var(--Base-Surface-Secondary-light-Normal);
|
||||
padding: var(--Spacing-x2);
|
||||
}
|
||||
|
||||
.backButton {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
color: var(--Base-Text-High-contrast);
|
||||
font-family: var(--typography-Subtitle-1-fontFamily);
|
||||
font-weight: var(--typography-Subtitle-1-fontWeight);
|
||||
font-size: var(--typography-Subtitle-1-Mobile-fontSize);
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--Spacing-x1);
|
||||
}
|
||||
|
||||
.languageWrapper {
|
||||
display: grid;
|
||||
gap: var(--Spacing-x3);
|
||||
padding: var(--Spacing-x3) var(--Spacing-x2);
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-family: var(--typography-Subtitle-2-fontFamily);
|
||||
font-size: var(--typography-Subtitle-2-Mobile-fontSize);
|
||||
font-weight: var(--typography-Subtitle-2-fontWeight);
|
||||
color: var(--Base-Text-High-contrast, #4d001b);
|
||||
}
|
||||
|
||||
.list {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.link {
|
||||
color: var(--Scandic-Brand-Burgundy);
|
||||
font-family: var(--typography-Body-Regular-fontFamily);
|
||||
font-size: var(--typography-Body-Regular-fontSize);
|
||||
line-height: var(--typography-Body-Regular-lineHeight);
|
||||
letter-spacing: var(--typography-Body-Regular-letterSpacing);
|
||||
padding: var(--Spacing-x1);
|
||||
border-radius: var(--Corner-radius-Medium);
|
||||
display: flex;
|
||||
gap: var(--Spacing-x1);
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
text-decoration: none;
|
||||
border-radius: var(--Corner-radius-Medium);
|
||||
}
|
||||
|
||||
.link.active,
|
||||
.link:hover {
|
||||
background-color: var(--Base-Surface-Primary-light-Hover-alt);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
.languageSwitcher {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.backWrapper,
|
||||
.backButton {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.languageWrapper {
|
||||
padding: var(--Spacing-x2) var(--Spacing-x3);
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.dropdown {
|
||||
position: absolute;
|
||||
top: 2.25rem;
|
||||
@@ -153,8 +73,4 @@
|
||||
font-size: var(--typography-Body-Bold-fontSize);
|
||||
font-family: var(--typography-Body-Bold-fontFamily);
|
||||
}
|
||||
|
||||
.link.active:not(:hover) {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import { cva } from "class-variance-authority"
|
||||
|
||||
import styles from "./languageSwitcher.module.css"
|
||||
|
||||
export const languageSwitcherVariants = cva(styles.languageSwitcher, {
|
||||
variants: {
|
||||
variant: {
|
||||
mobileHeader: styles.mobileHeader,
|
||||
mobileFooter: styles.mobileFooter,
|
||||
desktopHeader: styles.desktopHeader,
|
||||
desktopFooter: styles.desktopFooter,
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: "desktopHeader",
|
||||
},
|
||||
})
|
||||
@@ -45,7 +45,6 @@ export function useTrapFocus(opts?: OptionsType) {
|
||||
const first = tabbableElements[0]
|
||||
const last = tabbableElements[tabbableElements.length - 1]
|
||||
|
||||
console.log(tabbableElements)
|
||||
const currentActiveElement = document.activeElement
|
||||
// Scope current tabs to current root element
|
||||
if (isWithinCurrentElementScope([...tabbableElements, ref.current])) {
|
||||
|
||||
@@ -87,8 +87,8 @@
|
||||
"Level 7": "Niveau 7",
|
||||
"Level up to unlock": "Stig i niveau for at låse op",
|
||||
"Log in": "Log på",
|
||||
"Log in/Join": "Log på/Tilmeld dig",
|
||||
"Log in here": "Log ind her",
|
||||
"Log in/Join": "Log på/Tilmeld dig",
|
||||
"Log out": "Log ud",
|
||||
"Manage preferences": "Administrer præferencer",
|
||||
"Meetings & Conferences": "Møder & Konferencer",
|
||||
|
||||
@@ -86,8 +86,8 @@
|
||||
"Level 7": "Level 7",
|
||||
"Level up to unlock": "Zum Freischalten aufsteigen",
|
||||
"Log in": "Anmeldung",
|
||||
"Log in/Join": "Log in/Anmelden",
|
||||
"Log in here": "Hier einloggen",
|
||||
"Log in/Join": "Log in/Anmelden",
|
||||
"Log out": "Ausloggen",
|
||||
"Manage preferences": "Verwalten von Voreinstellungen",
|
||||
"Membership ID copied to clipboard": "Mitglieds-ID in die Zwischenablage kopiert",
|
||||
|
||||
@@ -92,8 +92,8 @@
|
||||
"Level 7": "Level 7",
|
||||
"Level up to unlock": "Level up to unlock",
|
||||
"Log in": "Log in",
|
||||
"Log in/Join": "Log in/Join",
|
||||
"Log in here": "Log in here",
|
||||
"Log in/Join": "Log in/Join",
|
||||
"Log out": "Log out",
|
||||
"Manage preferences": "Manage preferences",
|
||||
"Meetings & Conferences": "Meetings & Conferences",
|
||||
|
||||
@@ -86,8 +86,8 @@
|
||||
"Level 6": "Taso 6",
|
||||
"Level 7": "Taso 7",
|
||||
"Log in": "Kirjaudu sisään",
|
||||
"Log in/Join": "Kirjaudu sisään/Liittyä",
|
||||
"Log in here": "Kirjaudu sisään",
|
||||
"Log in/Join": "Kirjaudu sisään/Liittyä",
|
||||
"Log out": "Kirjaudu ulos",
|
||||
"Manage preferences": "Asetusten hallinta",
|
||||
"Meetings & Conferences": "Kokoukset & Konferenssit",
|
||||
@@ -97,7 +97,7 @@
|
||||
"Members": "Jäsenet",
|
||||
"Membership cards": "Jäsenkortit",
|
||||
"Membership ID": "Jäsentunnus",
|
||||
"Menu": "Menu",
|
||||
"Menu": "Valikko",
|
||||
"Modify": "Muokkaa",
|
||||
"Month": "Kuukausi",
|
||||
"My communication preferences": "Viestintämieltymykseni",
|
||||
|
||||
@@ -45,9 +45,9 @@
|
||||
"Could not find requested resource": "Kunne ikke finne den forespurte ressursen",
|
||||
"Country": "Land",
|
||||
"Country code": "Landskode",
|
||||
"Customer service": "Kundeservice",
|
||||
"Credit card deleted successfully": "Kredittkort slettet",
|
||||
"Current password": "Nåværende passord",
|
||||
"Customer service": "Kundeservice",
|
||||
"Date of Birth": "Fødselsdato",
|
||||
"Day": "Dag",
|
||||
"Description": "Beskrivelse",
|
||||
@@ -87,8 +87,8 @@
|
||||
"Level 7": "Nivå 7",
|
||||
"Level up to unlock": "Nivå opp for å låse opp",
|
||||
"Log in": "Logg Inn",
|
||||
"Log in/Join": "Logg på/Bli med",
|
||||
"Log in here": "Logg inn her",
|
||||
"Log in/Join": "Logg på/Bli med",
|
||||
"Log out": "Logg ut",
|
||||
"Manage preferences": "Administrer preferanser",
|
||||
"Meetings & Conferences": "Møter & Konferanser",
|
||||
|
||||
@@ -89,8 +89,8 @@
|
||||
"Level 7": "Nivå 7",
|
||||
"Level up to unlock": "Levla upp för att låsa upp",
|
||||
"Log in": "Logga in",
|
||||
"Log in/Join": "Logga in/Gå med",
|
||||
"Log in here": "Logga in här",
|
||||
"Log in/Join": "Logga in/Gå med",
|
||||
"Log out": "Logga ut",
|
||||
"Manage preferences": "Hantera inställningar",
|
||||
"Meetings & Conferences": "Möten & Konferenser",
|
||||
@@ -106,8 +106,8 @@
|
||||
"My communication preferences": "Mina kommunikationspreferenser",
|
||||
"My membership cards": "Mina medlemskort",
|
||||
"My pages": "Mina sidor",
|
||||
"My payment cards": "Mina betalningskort",
|
||||
"My pages menu": "Mina sidor meny",
|
||||
"My payment cards": "Mina betalningskort",
|
||||
"My wishes": "Mina önskningar",
|
||||
"New password": "Nytt lösenord",
|
||||
"Next": "Nästa",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ImageProps } from "next/image"
|
||||
import type { ImageProps } from "next/image"
|
||||
|
||||
export interface AvatarProps {
|
||||
image?: ImageProps
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import { LinkProps } from "@/components/TempDesignSystem/Link/link"
|
||||
import type { LinkProps } from "@/components/TempDesignSystem/Link/link"
|
||||
|
||||
export interface HeaderLinkProps extends React.PropsWithChildren<LinkProps> {}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import { VariantProps } from "class-variance-authority"
|
||||
|
||||
import { languageSwitcherVariants } from "@/components/LanguageSwitcher/variants"
|
||||
|
||||
import { LanguageSwitcherData } from "@/types/requests/languageSwitcher"
|
||||
|
||||
export interface LanguageSwitcherProps
|
||||
extends VariantProps<typeof languageSwitcherVariants> {
|
||||
urls: LanguageSwitcherData
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LanguageSwitcherData } from "@/types/requests/languageSwitcher"
|
||||
import type { LanguageSwitcherData } from "@/types/requests/languageSwitcher"
|
||||
|
||||
export interface MainMenuProps {
|
||||
languageUrls: LanguageSwitcherData
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { MainNavigationItem } from "./mainNavigationItem"
|
||||
|
||||
import { LanguageSwitcherData } from "@/types/requests/languageSwitcher"
|
||||
import type { LanguageSwitcherData } from "@/types/requests/languageSwitcher"
|
||||
|
||||
export interface MobileMenuProps {
|
||||
languageUrls: LanguageSwitcherData
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { navigationQueryRouter } from "@/server/routers/contentstack/myPages/navigation/query"
|
||||
|
||||
import { User } from "@/types/user"
|
||||
import type { User } from "@/types/user"
|
||||
|
||||
type MyPagesNavigation = Awaited<
|
||||
ReturnType<(typeof navigationQueryRouter)["get"]>
|
||||
|
||||
@@ -2,7 +2,7 @@ import { VariantProps } from "class-variance-authority"
|
||||
|
||||
import { navigationMenuVariants } from "@/components/Header/MainMenu/NavigationMenu/variants"
|
||||
|
||||
import { MainNavigationItem } from "@/types/components/header/mainNavigationItem"
|
||||
import type { MainNavigationItem } from "@/types/components/header/mainNavigationItem"
|
||||
|
||||
export interface NavigationMenuProps
|
||||
extends VariantProps<typeof navigationMenuVariants> {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { VariantProps } from "class-variance-authority"
|
||||
|
||||
import { navigationMenuItemVariants } from "@/components/Header/MainMenu/NavigationMenu/NavigationMenuItem/variants"
|
||||
|
||||
import { MainNavigationItem } from "@/types/components/header/mainNavigationItem"
|
||||
import type { MainNavigationItem } from "@/types/components/header/mainNavigationItem"
|
||||
|
||||
export interface NavigationMenuItemProps
|
||||
extends VariantProps<typeof navigationMenuItemVariants> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LanguageSwitcherData } from "@/types/requests/languageSwitcher"
|
||||
import type { LanguageSwitcherData } from "@/types/requests/languageSwitcher"
|
||||
|
||||
export interface TopMenuProps {
|
||||
languageUrls: LanguageSwitcherData
|
||||
|
||||
6
types/components/languageSwitcher/languageSwitcher.ts
Normal file
6
types/components/languageSwitcher/languageSwitcher.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { LanguageSwitcherData } from "@/types/requests/languageSwitcher"
|
||||
|
||||
export interface LanguageSwitcherProps {
|
||||
type: "mobileHeader" | "mobileFooter" | "desktopHeader" | "desktopFooter"
|
||||
urls: LanguageSwitcherData
|
||||
}
|
||||
@@ -20,15 +20,6 @@ function hidesContents(element: HTMLElement) {
|
||||
|
||||
// Otherwise we need to check some styles
|
||||
const style = window.getComputedStyle(element)
|
||||
console.log({
|
||||
element,
|
||||
zeroSize,
|
||||
display: style.display,
|
||||
overflow: style.overflow,
|
||||
returns:
|
||||
style.getPropertyValue("display") === "none" ||
|
||||
(zeroSize && style.getPropertyValue("overflow") !== "visible"),
|
||||
})
|
||||
return (
|
||||
style.getPropertyValue("display") === "none" ||
|
||||
(zeroSize && style.getPropertyValue("overflow") !== "visible")
|
||||
|
||||
Reference in New Issue
Block a user