From 43ba36af61dddaaa2217ffb6638b30a1f499db69 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Tue, 2 Jul 2024 10:06:19 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5(frontend)=20remove=20coming-soon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the coming-soon page and the redirection to it. --- .../apps/impress/src/core/auth/Auth.tsx | 24 ++----------- .../impress/src/pages/coming-soon/index.tsx | 35 ------------------- 2 files changed, 3 insertions(+), 56 deletions(-) delete mode 100644 src/frontend/apps/impress/src/pages/coming-soon/index.tsx diff --git a/src/frontend/apps/impress/src/core/auth/Auth.tsx b/src/frontend/apps/impress/src/core/auth/Auth.tsx index 7cc312dc..ff89021b 100644 --- a/src/frontend/apps/impress/src/core/auth/Auth.tsx +++ b/src/frontend/apps/impress/src/core/auth/Auth.tsx @@ -1,35 +1,17 @@ import { Loader } from '@openfun/cunningham-react'; -import { usePathname, useRouter } from 'next/navigation'; -import { PropsWithChildren, useEffect, useState } from 'react'; +import { PropsWithChildren, useEffect } from 'react'; import { Box } from '@/components'; import { useAuthStore } from './useAuthStore'; export const Auth = ({ children }: PropsWithChildren) => { const { authenticated, initAuth } = useAuthStore(); - const router = useRouter(); - const [isDomainComingSoon, setIsDomainComingSoon] = useState(false); - const domainComingSoon = 'docs.numerique.gouv.fr'; - const pathComingSoon = '/coming-soon/'; - const pathname = usePathname(); useEffect(() => { - if (window.location.origin.includes(domainComingSoon)) { - router.push(pathComingSoon); - return; - } - initAuth(); - }, [initAuth, router]); + }, [initAuth]); - useEffect(() => { - setIsDomainComingSoon( - window.location.origin.includes(domainComingSoon) && - pathname === pathComingSoon, - ); - }, [pathname]); - - if (!authenticated && !isDomainComingSoon) { + if (!authenticated) { return ( diff --git a/src/frontend/apps/impress/src/pages/coming-soon/index.tsx b/src/frontend/apps/impress/src/pages/coming-soon/index.tsx deleted file mode 100644 index cd5de772..00000000 --- a/src/frontend/apps/impress/src/pages/coming-soon/index.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { ReactElement } from 'react'; -import { useTranslation } from 'react-i18next'; - -import Icon404 from '@/assets/icons/icon-404.svg'; -import { Box, Text } from '@/components'; -import { NextPageWithLayout } from '@/types/next'; - -const Page: NextPageWithLayout = () => { - const { t } = useTranslation(); - - return ( - - - - - - {t('Coming soon ...')} - - - - - ); -}; - -Page.getLayout = function getLayout(page: ReactElement) { - return {page}; -}; - -export default Page;