Skip to content

Commit f23e19f

Browse files
committed
fixup! ✨(frontend) add onboarding modal with help menu button
1 parent eddd3df commit f23e19f

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

src/backend/impress/configuration/theme/default.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"onboarding": {
3+
"learn_more_url": ""
4+
},
25
"footer": {
36
"default": {
47
"logo": {

src/frontend/apps/impress/src/core/config/api/useConfig.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ interface ThemeCustomization {
1616
light: LinkHTMLAttributes<HTMLLinkElement>;
1717
dark: LinkHTMLAttributes<HTMLLinkElement>;
1818
};
19+
onboarding?: {
20+
learn_more_url?: string;
21+
};
1922
footer?: FooterType;
2023
home: {
2124
'with-proconnect'?: boolean;

src/frontend/apps/impress/src/features/left-panel/components/LeftPanelHelpMenu.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ import { useTranslation } from 'react-i18next';
55
import { css } from 'styled-components';
66

77
import { Box } from '@/components';
8+
import { useConfig } from '@/core/config/api';
89
import { OnBoarding } from '@/features/on-boarding/components/OnBoarding';
910

1011
import HelpOutlineIcon from '../assets/help-outline.svg';
1112
import WandAndStarsIcon from '../assets/wand-and-stars.svg';
1213

1314
export const LeftPanelHelpMenu = () => {
1415
const { t } = useTranslation();
16+
const { data: config } = useConfig();
1517
const [isMenuOpen, setIsMenuOpen] = useState(false);
1618
const [isModalOpen, setIsModalOpen] = useState(false);
1719

@@ -37,6 +39,8 @@ export const LeftPanelHelpMenu = () => {
3739
],
3840
[openModal, t],
3941
);
42+
const learnMoreUrl =
43+
config?.theme_customization?.onboarding?.learn_more_url?.trim();
4044

4145
return (
4246
<>
@@ -70,10 +74,14 @@ export const LeftPanelHelpMenu = () => {
7074
isOpen={isModalOpen}
7175
onClose={closeModal}
7276
onSkip={closeModal}
73-
footerLink={{
74-
label: t('Learn more docs features'),
75-
href: 'https://docs.numerique.gouv.fr/docs/335e43b5-9e16-4798-a0b4-912e44c7135e/',
76-
}}
77+
footerLink={
78+
learnMoreUrl
79+
? {
80+
label: t('Learn more docs features'),
81+
href: learnMoreUrl,
82+
}
83+
: undefined
84+
}
7785
/>
7886
</>
7987
);

0 commit comments

Comments
 (0)