From 07c2323499c4c5b2b4c242fbd006e360fc993430 Mon Sep 17 00:00:00 2001 From: Ovgodd Date: Tue, 25 Aug 2026 12:46:54 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F(frontend)=20extract=20shared?= =?UTF-8?q?=20footer=20actions=20and=20bar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Footer actions lived in the left panel and could not be reused elsewhere. --- .../footer/components/FooterActions.tsx | 51 +++++++++++++++++++ .../features/footer/components/FooterBar.tsx | 17 +++++++ .../src/features/footer/components/index.ts | 2 + .../impress/src/features/footer/index.tsx | 1 + .../left-panel/components/LeftPanelFooter.tsx | 46 ++--------------- 5 files changed, 74 insertions(+), 43 deletions(-) create mode 100644 src/frontend/apps/impress/src/features/footer/components/FooterActions.tsx create mode 100644 src/frontend/apps/impress/src/features/footer/components/FooterBar.tsx create mode 100644 src/frontend/apps/impress/src/features/footer/components/index.ts diff --git a/src/frontend/apps/impress/src/features/footer/components/FooterActions.tsx b/src/frontend/apps/impress/src/features/footer/components/FooterActions.tsx new file mode 100644 index 000000000..1640929b9 --- /dev/null +++ b/src/frontend/apps/impress/src/features/footer/components/FooterActions.tsx @@ -0,0 +1,51 @@ +import { UserMenu } from '@gouvfr-lasuite/ui-components'; +import { useTranslation } from 'react-i18next'; +import { createGlobalStyle } from 'styled-components'; + +import { Box } from '@/components'; +import { Waffle } from '@/components/Waffle'; +import { ButtonLogin, gotoLogout, useAuth } from '@/features/auth'; +import { HelpMenu } from '@/features/help'; +import { LanguagePicker } from '@/features/language/components/LanguagePicker'; + +const FooterActionsGlobalStyle = createGlobalStyle` + .user-menu__actions .c__language-picker{ + width: auto; + } +`; + +export const FooterActions = () => { + const { t } = useTranslation(); + const { user } = useAuth(); + + const userMenu = user || { + full_name: t('Guest'), + email: '', + }; + + return ( + <> + + + + } + withMobileView={false} + /> + + + + + + + ); +}; diff --git a/src/frontend/apps/impress/src/features/footer/components/FooterBar.tsx b/src/frontend/apps/impress/src/features/footer/components/FooterBar.tsx new file mode 100644 index 000000000..539dc0690 --- /dev/null +++ b/src/frontend/apps/impress/src/features/footer/components/FooterBar.tsx @@ -0,0 +1,17 @@ +import { Box } from '@/components'; + +import { FooterActions } from './FooterActions'; + +export const FooterBar = () => { + return ( + + + + ); +}; diff --git a/src/frontend/apps/impress/src/features/footer/components/index.ts b/src/frontend/apps/impress/src/features/footer/components/index.ts new file mode 100644 index 000000000..720742b5c --- /dev/null +++ b/src/frontend/apps/impress/src/features/footer/components/index.ts @@ -0,0 +1,2 @@ +export * from './FooterActions'; +export * from './FooterBar'; diff --git a/src/frontend/apps/impress/src/features/footer/index.tsx b/src/frontend/apps/impress/src/features/footer/index.tsx index 166c3c20d..9b5b85b0c 100644 --- a/src/frontend/apps/impress/src/features/footer/index.tsx +++ b/src/frontend/apps/impress/src/features/footer/index.tsx @@ -1,2 +1,3 @@ +export * from './components'; export * from './Footer'; export * from './types'; diff --git a/src/frontend/apps/impress/src/features/left-panel/components/LeftPanelFooter.tsx b/src/frontend/apps/impress/src/features/left-panel/components/LeftPanelFooter.tsx index f152234fb..56733d35c 100644 --- a/src/frontend/apps/impress/src/features/left-panel/components/LeftPanelFooter.tsx +++ b/src/frontend/apps/impress/src/features/left-panel/components/LeftPanelFooter.tsx @@ -1,50 +1,10 @@ -import { UserMenu } from '@gouvfr-lasuite/ui-components'; -import { useTranslation } from 'react-i18next'; -import { createGlobalStyle } from 'styled-components'; - -import { Box, SeparatedSection } from '@/components'; -import { Waffle } from '@/components/Waffle'; -import { ButtonLogin } from '@/features/auth'; -import { useAuth } from '@/features/auth/hooks/useAuth'; -import { gotoLogout } from '@/features/auth/utils'; -import { HelpMenu } from '@/features/help'; -import { LanguagePicker } from '@/features/language/components/LanguagePicker'; - -const LeftPanelFooterGlobalStyle = createGlobalStyle` - .user-menu__actions .c__language-picker{ - width: auto; - } -`; +import { SeparatedSection } from '@/components'; +import { FooterActions } from '@/features/footer'; export const LeftPanelFooter = () => { - const { t } = useTranslation(); - const { user } = useAuth(); - - const userMenu = user || { - full_name: t('Guest'), - email: '', - }; - return ( - - - - } - withMobileView={false} - /> - - - - - + ); };