refactoring and cleaning

This commit is contained in:
Antoine M 2024-03-13 17:52:35 +01:00
parent 1f398ca655
commit 16f4f2297d

View File

@ -1,40 +1,50 @@
import Nav from "../components/ui/Nav"; import Lottie from "lottie-react";
import { useWordpressCustomData } from "../services/WordpressFetchData"; import { useUser } from "../hooks/useUser";
import coverWorker from "../assets/img/cover_worker.svg";
import screenWorker1 from "../assets/img/screen_worker_1.svg";
import screenWorker2 from "../assets/img/screen_worker_2.svg";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import Nav from "../components/ui/Nav";
import coverWorker from "../assets/img/illustrations/cover_worker.svg";
import screenWorker1 from "../assets/img/illustrations/screen_worker_1.svg";
import screenWorker2 from "../assets/img/illustrations/screen_worker_2.svg";
import AnimatedPage from "../components/AnimatedPage"; import AnimatedPage from "../components/AnimatedPage";
// import screensTranslations from "../data/screensTranslations.json"; import cloudPageTransition from "../assets/animations/transition-nuages-pages";
import { useUser } from "../hooks/useUser";
import { useEffect } from "react";
export default function Home() { export default function Home() {
const { language, screensTranslations } = useUser(); const { screensTranslations } = useUser();
if (!screensTranslations || !screensTranslations.home) return <p>loading</p>; if (!screensTranslations || !screensTranslations.home) return <p>loading</p>;
const currentScreenTranslations = screensTranslations.home; const currentScreenTranslations = screensTranslations.home;
return ( return (
<AnimatedPage className='page-container page-container--home'> <>
<div className='screen screen--home'> <Lottie
<Nav /> // lottieRef={playerRef}
<section className='screen__content'> className='test-load-animation'
<img className='cover_worker' src={coverWorker} alt='' /> animationData={cloudPageTransition}
<h1 className='application_title'>stay safe</h1> speed={21}
<h2 className='application_subtitle'>interactive</h2> loop={false}
<p className='application_description'> autoplay
{currentScreenTranslations.app_description} />
</p>
<Link <AnimatedPage className='page-container page-container--home'>
to='/select-profile' <div className='screen screen--home'>
className='cta cta--construction cta--round cta--button-icon cta--play ' <Nav />
/> <section className='screen__content'>
</section> <img className='cover_worker' src={coverWorker} alt='' />
<img className='screen_worker_1' src={screenWorker1} alt='' /> <h1 className='application_title'>stay safe</h1>
<img className='screen_worker_2' src={screenWorker2} alt='' /> <h2 className='application_subtitle'>interactive</h2>
</div> <p className='application_description'>
</AnimatedPage> {currentScreenTranslations.app_description}
</p>
<Link
to='/select-profile'
className='cta cta--construction cta--round cta--button-icon cta--play '
/>
</section>
<img className='screen_worker_1' src={screenWorker1} alt='' />
<img className='screen_worker_2' src={screenWorker2} alt='' />
</div>
</AnimatedPage>
</>
); );
} }