diff --git a/src/app/apple-icon.tsx b/src/app/apple-icon.tsx index f594f156..85294345 100644 --- a/src/app/apple-icon.tsx +++ b/src/app/apple-icon.tsx @@ -86,62 +86,62 @@ export default function Icon({ id }: { id: string }) { xmlns="http://www.w3.org/2000/svg" > diff --git a/src/app/icon.tsx b/src/app/icon.tsx index 61cc18cc..1b981273 100644 --- a/src/app/icon.tsx +++ b/src/app/icon.tsx @@ -66,62 +66,62 @@ export default function Icon({ id }: { id: string }) { xmlns="http://www.w3.org/2000/svg" > diff --git a/src/features/common/assets/arrow-head-icon.component.tsx b/src/features/common/assets/arrow-head-icon.component.tsx index a0a25859..0910b453 100644 --- a/src/features/common/assets/arrow-head-icon.component.tsx +++ b/src/features/common/assets/arrow-head-icon.component.tsx @@ -12,9 +12,9 @@ export const ArrowHeadIconComponent: React.FC = () => { ); diff --git a/src/features/common/assets/download-icon.component.tsx b/src/features/common/assets/download-icon.component.tsx index c7eb7ec2..f401a279 100644 --- a/src/features/common/assets/download-icon.component.tsx +++ b/src/features/common/assets/download-icon.component.tsx @@ -12,16 +12,16 @@ export const DownloadIconComponent: React.FC = () => { ); diff --git a/src/features/common/components/bars/ribbon/assets/dark-icon.component.tsx b/src/features/common/components/bars/ribbon/assets/dark-icon.component.tsx index 7607d241..3961a806 100644 --- a/src/features/common/components/bars/ribbon/assets/dark-icon.component.tsx +++ b/src/features/common/components/bars/ribbon/assets/dark-icon.component.tsx @@ -12,8 +12,8 @@ export const DarkIconComponent: React.FC = () => { ); diff --git a/src/features/common/components/bars/ribbon/assets/globe-icon.component.tsx b/src/features/common/components/bars/ribbon/assets/globe-icon.component.tsx index 7552b6c2..71ee0194 100644 --- a/src/features/common/components/bars/ribbon/assets/globe-icon.component.tsx +++ b/src/features/common/components/bars/ribbon/assets/globe-icon.component.tsx @@ -3,10 +3,11 @@ import React from "react"; export const GlobeIconComponent: React.FC = () => { return ( ); diff --git a/src/features/common/components/bars/ribbon/ribbon.component.tsx b/src/features/common/components/bars/ribbon/ribbon.component.tsx index 3403d15e..4827cb2f 100644 --- a/src/features/common/components/bars/ribbon/ribbon.component.tsx +++ b/src/features/common/components/bars/ribbon/ribbon.component.tsx @@ -14,7 +14,6 @@ import { import { RibbonPickerComponent } from "@/features/common/components/bars/ribbon/ribbon-picker/ribbon-picker.component"; import { LightIconComponent } from "@/features/common/components/bars/ribbon/assets/light-icon.component"; import { DarkIconComponent } from "@/features/common/components/bars/ribbon/assets/dark-icon.component"; -import { GlobeIconComponent } from "@/features/common/components/bars/ribbon/assets/globe-icon.component"; import { ThemeModel } from "@/features/common/models/theme.model"; import { useAppStore } from "@/features/common/services/app.store"; import { SystemIconComponent } from "@/features/common/components/bars/ribbon/assets/system-icon.component"; @@ -37,10 +36,6 @@ export const RibbonComponent: React.FC = ({ }) => { const theme$ = useAppStore((state) => state.theme$); - const currentLanguage = dictionary.languagePicker.options.filter( - (element) => element.code === languageCode, - )[0]; - const sanitizedThemePickerCodeValue = useMemo(() => { return getSanitizedThemePickerCodeValue(themeCode); }, [themeCode]); @@ -85,25 +80,6 @@ export const RibbonComponent: React.FC = ({ [dictionary.themePicker.options], ); - const languageOptions = useMemo( - () => - dictionary.languagePicker.options.map((option) => { - return { - code: option.code, - full: { - ...option, - icon: null, - }, - compact: { - ...option, - label: option.code.toUpperCase(), - icon: null, - }, - }; - }), - [dictionary.languagePicker.options], - ); - const handleThemeSelection = useCallback( async (value: ThemePickerCodeValues) => { const themePreference = await savePreferredThemeInCookie( @@ -202,21 +178,6 @@ export const RibbonComponent: React.FC = ({ listLabel: dictionary.themePicker.list.ariaLabel, }} /> - {dictionary.languagePicker.options.length > 1 && ( - } - label={currentLanguage.label} - compactLabel={currentLanguage.code.toUpperCase()} - languageCode={languageCode} - selectedOptionCode={languageCode} - handleSelection={handleLanguageSelection} - options={languageOptions} - aria={{ - buttonLabel: dictionary.languagePicker.button.ariaLabel, - listLabel: dictionary.languagePicker.list.ariaLabel, - }} - /> - )} diff --git a/src/features/common/components/footer/footer.component.tsx b/src/features/common/components/footer/footer.component.tsx index ad06e00d..1c91d81c 100644 --- a/src/features/common/components/footer/footer.component.tsx +++ b/src/features/common/components/footer/footer.component.tsx @@ -1,6 +1,12 @@ "use client"; import React, { MouseEvent, useState } from "react"; +import Select, { + SingleValue, + OptionsOrGroups, + GroupBase, + NonceProvider, +} from "react-select"; import { FooterIconsComponent } from "./footer-Icons.component"; import { MonoFont, SecondaryFont } from "@/libs/theme/fonts"; import Image from "next/image"; @@ -18,6 +24,9 @@ import { SiteBrandComponent } from "@/features/common/components/site-brand/site import { Button } from "react-aria-components"; import { Auth0LogoComponent } from "../../assets/auth0-logo.component"; import { getBrandDictionary } from "@/features/localization/services/brand-dictionary.service"; +import { savePreferredLanguage } from "@/features/localization/services/ui-language.utils"; +import { UiLanguageModel } from "../../models/ui-language.model"; +import { GlobeIconComponent } from "../bars/ribbon/assets/globe-icon.component"; interface FooterComponentProps { languageCode: string; @@ -28,8 +37,19 @@ export const FooterComponent: React.FC = ({ languageCode, dictionary, }) => { + const currentLanguage = dictionary.languagePicker.options.filter( + (element) => element.value === languageCode + )[0]; + + const handleChange = (selection: SingleValue) => { + if (!selection) { + return; + } + savePreferredLanguage(selection.value); + }; + const [modalState, setModalState] = useState( - ModalStateValues.CLOSED, + ModalStateValues.CLOSED ); const images = getBrandDictionary(languageCode); @@ -64,7 +84,10 @@ export const FooterComponent: React.FC = ({ contentClassName={styles.content} >
- +
@@ -110,7 +133,7 @@ export const FooterComponent: React.FC = ({ }} className={clsx( styles.resource__button, - SecondaryFont.className, + SecondaryFont.className )} > {trigger.text} @@ -158,11 +181,80 @@ export const FooterComponent: React.FC = ({ target="_blank" href="https://auth0.com/" > - + {dictionary.copyright} + {dictionary.languagePicker.options.length > 1 && ( +
+ +