From e7e7bb0d09fea3c589ec5d8fc8853d34778979c6 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Tue, 3 Dec 2024 00:13:48 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A9(frontend)=20introduce=20an=20offic?= =?UTF-8?q?ial=20footer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on Florian's feedbacks, this is mandatory as the project is getting attention. Bad code, needs a refactor. --- src/frontend/public/assets/link-grey.svg | 3 + src/frontend/src/components/LoadingScreen.tsx | 3 +- src/frontend/src/components/QueryAware.tsx | 2 +- .../features/auth/components/UserAware.tsx | 2 +- .../features/rooms/components/Conference.tsx | 2 +- src/frontend/src/layout/Footer.tsx | 276 ++++++++++++++++++ src/frontend/src/layout/Layout.tsx | 38 ++- src/frontend/src/layout/Screen.tsx | 7 +- src/frontend/src/locales/de/global.json | 16 +- src/frontend/src/locales/en/global.json | 16 +- src/frontend/src/locales/fr/global.json | 16 +- src/frontend/src/primitives/A.tsx | 45 ++- src/frontend/src/stores/layout.ts | 2 + 13 files changed, 402 insertions(+), 26 deletions(-) create mode 100644 src/frontend/public/assets/link-grey.svg create mode 100644 src/frontend/src/layout/Footer.tsx diff --git a/src/frontend/public/assets/link-grey.svg b/src/frontend/public/assets/link-grey.svg new file mode 100644 index 00000000..aa71474b --- /dev/null +++ b/src/frontend/public/assets/link-grey.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/frontend/src/components/LoadingScreen.tsx b/src/frontend/src/components/LoadingScreen.tsx index ded2c21b..a4989ba6 100644 --- a/src/frontend/src/components/LoadingScreen.tsx +++ b/src/frontend/src/components/LoadingScreen.tsx @@ -7,6 +7,7 @@ import { Center } from '@/styled-system/jsx' export const LoadingScreen = ({ delay = 500, header = undefined, + footer = undefined, layout = 'centered', }: { delay?: number @@ -15,7 +16,7 @@ export const LoadingScreen = ({ return ( - +

{t('loading')}

diff --git a/src/frontend/src/components/QueryAware.tsx b/src/frontend/src/components/QueryAware.tsx index 98e8182a..2053da27 100644 --- a/src/frontend/src/components/QueryAware.tsx +++ b/src/frontend/src/components/QueryAware.tsx @@ -21,7 +21,7 @@ export const QueryAware = ({ } if (status === 'pending') { - return + return } return children diff --git a/src/frontend/src/features/auth/components/UserAware.tsx b/src/frontend/src/features/auth/components/UserAware.tsx index 3a4b84cb..ec9028cd 100644 --- a/src/frontend/src/features/auth/components/UserAware.tsx +++ b/src/frontend/src/features/auth/components/UserAware.tsx @@ -15,6 +15,6 @@ export const UserAware = ({ children }: { children: React.ReactNode }) => { return isLoggedIn !== undefined ? ( children ) : ( - + ) } diff --git a/src/frontend/src/features/rooms/components/Conference.tsx b/src/frontend/src/features/rooms/components/Conference.tsx index 4071637a..0c38ac51 100644 --- a/src/frontend/src/features/rooms/components/Conference.tsx +++ b/src/frontend/src/features/rooms/components/Conference.tsx @@ -99,7 +99,7 @@ export const Conference = ({ return ( - + { + return ( +
+

+ gouvernement +

+
+ ) +} + +export const Footer = () => { + const { t } = useTranslation('global', { keyPrefix: 'footer' }) + + return ( + + ) +} diff --git a/src/frontend/src/layout/Layout.tsx b/src/frontend/src/layout/Layout.tsx index 9159a0c7..e8274b18 100644 --- a/src/frontend/src/layout/Layout.tsx +++ b/src/frontend/src/layout/Layout.tsx @@ -3,6 +3,7 @@ import { css } from '@/styled-system/css' import { Header } from './Header' import { layoutStore } from '@/stores/layout' import { useSnapshot } from 'valtio' +import { Footer } from '@/layout/Footer' export type Layout = 'fullpage' | 'centered' @@ -15,28 +16,33 @@ export type Layout = 'fullpage' | 'centered' export const Layout = ({ children }: { children: ReactNode }) => { const layoutSnap = useSnapshot(layoutStore) const showHeader = layoutSnap.showHeader + const showFooter = layoutSnap.showFooter return ( -
- {showHeader &&
} -
+
- {children} -
-
+ {showHeader &&
} +
+ {children} +
+ + {showFooter &&