From 29b99834ca0488c690a5b019b9745e843c84a9ee Mon Sep 17 00:00:00 2001 From: Mikael Brevik Date: Wed, 11 Dec 2024 13:15:20 +0100 Subject: [PATCH 1/3] fix: issue with not marking language as selected --- .../languageSwitcher/LanguageSwitcher.tsx | 11 ++++------- .../languageSwitcher/languageSwitcher.module.css | 14 ++------------ 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/components/languageSwitcher/LanguageSwitcher.tsx b/src/components/languageSwitcher/LanguageSwitcher.tsx index a99348be7..a902262e9 100644 --- a/src/components/languageSwitcher/LanguageSwitcher.tsx +++ b/src/components/languageSwitcher/LanguageSwitcher.tsx @@ -1,7 +1,6 @@ import Link from "next/link"; import { Fragment } from "react"; -import Text from "src/components/text/Text"; import { InternationalizedString } from "studio/lib/interfaces/global"; import styles from "./languageSwitcher.module.css"; @@ -26,18 +25,16 @@ export default function LanguageSwitcher({
  • {pathTranslation._key !== currentLanguage ? ( - - {pathTranslation._key.toUpperCase()} - + {pathTranslation._key.toUpperCase()} ) : ( - + {pathTranslation._key.toUpperCase()} - + )}
  • {index < pathTranslations.length - 1 && ( diff --git a/src/components/languageSwitcher/languageSwitcher.module.css b/src/components/languageSwitcher/languageSwitcher.module.css index 090a16be8..aa0e6f58a 100644 --- a/src/components/languageSwitcher/languageSwitcher.module.css +++ b/src/components/languageSwitcher/languageSwitcher.module.css @@ -17,6 +17,8 @@ line-height: 120%; font-weight: 300; + text-decoration: none; + &:hover { text-decoration: underline; } @@ -28,20 +30,8 @@ line-height: 120%; font-weight: 600; - &:hover { - text-decoration: underline; - } - &:active { font-weight: 600; text-decoration: none; } } - -.notSelected { - text-decoration: none; - - &:hover { - text-decoration: underline; - } -} From 56c8b8a2289a2c6f32f8ea293715f27871a4e907 Mon Sep 17 00:00:00 2001 From: Mikael Brevik Date: Wed, 11 Dec 2024 13:25:27 +0100 Subject: [PATCH 2/3] fix: language setting issue --- src/app/(main)/[locale]/layout.tsx | 58 +++++++++++++----------------- src/app/layout.tsx | 14 ++++++-- 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/src/app/(main)/[locale]/layout.tsx b/src/app/(main)/[locale]/layout.tsx index 61d2842a8..3852b5123 100644 --- a/src/app/(main)/[locale]/layout.tsx +++ b/src/app/(main)/[locale]/layout.tsx @@ -1,4 +1,3 @@ -import localFont from "next/font/local"; import { draftMode } from "next/headers"; import { notFound } from "next/navigation"; import { NextIntlClientProvider } from "next-intl"; @@ -27,11 +26,6 @@ import { import { loadStudioQuery } from "studio/lib/store"; import "src/styles/global.css"; -const fontBrittiSans = localFont({ - src: "../../../../public/_assets/britti-sans-variable.woff2", - variable: "--font-britti-sans", -}); - const hasValidData = (data: unknown) => data && Object.keys(data).length > 0; export default async function Layout({ @@ -82,32 +76,30 @@ export default async function Layout({ const hasFooterData = hasNavData && initialNav.data.footer; return ( - - - - - {children} - {hasFooterData && isDraftMode ? ( - - ) : ( -