handlign translations
This commit is contained in:
parent
c87700f797
commit
1f5eabd026
|
|
@ -6,11 +6,12 @@ import menuToggleIcon from "../../assets/img/icons/icon-bars-menu-toggle.svg";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
import Logo from "./AppLogoVector.jsx";
|
import Logo from "./AppLogoVector.jsx";
|
||||||
|
import Loading from "../animations/Loading";
|
||||||
|
|
||||||
export default function Nav() {
|
export default function Nav() {
|
||||||
let location = useLocation();
|
let location = useLocation();
|
||||||
|
|
||||||
const { screensTranslations } = useUser();
|
const { language, screensTranslations } = useUser();
|
||||||
|
|
||||||
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
||||||
|
|
||||||
|
|
@ -37,8 +38,8 @@ export default function Nav() {
|
||||||
exit: { y: "-100%" },
|
exit: { y: "-100%" },
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!screensTranslations || !screensTranslations.ui || !screensTranslations.pagesName) return <p>loading</p>;
|
if (!screensTranslations || !screensTranslations.ui || !screensTranslations.pagesName) return <Loading />;
|
||||||
const uiTranslations = screensTranslations.ui;
|
const uiScreenTranslations = screensTranslations.ui;
|
||||||
const pagesNamesTranslations = screensTranslations.pagesName;
|
const pagesNamesTranslations = screensTranslations.pagesName;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -46,7 +47,7 @@ export default function Nav() {
|
||||||
{location && location.pathname != "/Home" ? <Logo /> : null}
|
{location && location.pathname != "/Home" ? <Logo /> : null}
|
||||||
<LanguageSelect />
|
<LanguageSelect />
|
||||||
<button
|
<button
|
||||||
title={uiTranslations.openMenu}
|
title={uiScreenTranslations.openMenu}
|
||||||
className='nav-menu-toggle cta cta--button cta--button-icon'
|
className='nav-menu-toggle cta cta--button cta--button-icon'
|
||||||
onClick={handleMenuOpen}>
|
onClick={handleMenuOpen}>
|
||||||
<img className='' src={menuToggleIcon} alt='' />
|
<img className='' src={menuToggleIcon} alt='' />
|
||||||
|
|
@ -61,7 +62,7 @@ export default function Nav() {
|
||||||
exit={animationParameters.exit}
|
exit={animationParameters.exit}
|
||||||
transition={{ duration: 0.4, ease: "easeOut" }}>
|
transition={{ duration: 0.4, ease: "easeOut" }}>
|
||||||
<button
|
<button
|
||||||
title={uiTranslations.closeMenu}
|
title={uiScreenTranslations.closeMenu}
|
||||||
className='cta cta--construction cta--button-icon cta--close'
|
className='cta cta--construction cta--button-icon cta--close'
|
||||||
onClick={handleMenuOpen}></button>
|
onClick={handleMenuOpen}></button>
|
||||||
|
|
||||||
|
|
@ -79,13 +80,17 @@ export default function Nav() {
|
||||||
|
|
||||||
<ul className='menu__legal-mentions'>
|
<ul className='menu__legal-mentions'>
|
||||||
<li>
|
<li>
|
||||||
<Link to='/confidentiality'>Politique de confidentialité</Link>
|
<Link to='/confidentiality'>
|
||||||
|
{pagesNamesTranslations.confidentiality}
|
||||||
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to='/conditions'> Conditions d'utilisation</Link>
|
<Link to='/conditions'>
|
||||||
|
{pagesNamesTranslations.conditions}
|
||||||
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to='/cookies'> Cookies</Link>
|
<Link to='/data'>{pagesNamesTranslations.cookies}</Link>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user