Skip to content

Commit e37119e

Browse files
committed
✨(frontend) add docs onboarding and help memu
Introduce an onboarding to guide users through core features.
1 parent aaecaf0 commit e37119e

File tree

18 files changed

+272
-110
lines changed

18 files changed

+272
-110
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ and this project adheres to
88

99
### Fixed
1010

11-
🐛(frontend) fix broadcast store sync #1846
11+
- 🐛(frontend) fix broadcast store sync #1846
12+
- ✨(frontend) add onboarding modal with help menu button #1868
1213

1314
## [v4.5.0] - 2026-01-28
1415

Lines changed: 2 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,5 @@
1-
import { Button } from '@gouvfr-lasuite/cunningham-react';
2-
import {
3-
DropdownMenu,
4-
DropdownMenuOption,
5-
OnboardingModal,
6-
OnboardingStep,
7-
} from '@gouvfr-lasuite/ui-kit';
8-
import { type MouseEvent, useCallback, useMemo, useState } from 'react';
9-
import { useTranslation } from 'react-i18next';
10-
import { css } from 'styled-components';
11-
12-
import WandAndStarsIcon from '@/assets/icons/wand-and-stars.svg';
13-
import { Box, Icon } from '@/components';
1+
import { OnBoarding } from '@/features/on-boarding/components/OnBoarding';
142

153
export const LeftPanelHelpMenu = () => {
16-
const { t } = useTranslation();
17-
const [isMenuOpen, setIsMenuOpen] = useState(false);
18-
const [isModalOpen, setIsModalOpen] = useState(false);
19-
20-
const openModal = useCallback(() => {
21-
setIsModalOpen(true);
22-
}, []);
23-
24-
const closeModal = useCallback(() => {
25-
setIsModalOpen(false);
26-
}, []);
27-
28-
const toggleMenu = useCallback(
29-
(event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {
30-
event.preventDefault();
31-
event.stopPropagation();
32-
setIsMenuOpen((open) => !open);
33-
},
34-
[],
35-
);
36-
37-
const steps = useMemo<OnboardingStep[]>(
38-
() => [
39-
{
40-
icon: <Icon iconName="edit" $size="20px" aria-hidden="true" />,
41-
title: t('Onboarding step 1 title'),
42-
description: t('Onboarding step 1 description'),
43-
},
44-
{
45-
icon: <Icon iconName="account_tree" $size="20px" aria-hidden="true" />,
46-
title: t('Onboarding step 2 title'),
47-
description: t('Onboarding step 2 description'),
48-
},
49-
{
50-
icon: <Icon iconName="share" $size="20px" aria-hidden="true" />,
51-
title: t('Onboarding step 3 title'),
52-
description: t('Onboarding step 3 description'),
53-
},
54-
],
55-
[t],
56-
);
57-
58-
const options = useMemo<DropdownMenuOption[]>(
59-
() => [
60-
{
61-
label: t('Onboarding'),
62-
icon: <WandAndStarsIcon aria-hidden="true" />,
63-
callback: openModal,
64-
},
65-
],
66-
[openModal, t],
67-
);
68-
69-
return (
70-
<>
71-
<Box
72-
$css={css`
73-
.c__dropdown-menu-trigger {
74-
display: flex;
75-
justify-content: flex-start;
76-
}
77-
`}
78-
>
79-
<DropdownMenu
80-
options={options}
81-
isOpen={isMenuOpen}
82-
onOpenChange={setIsMenuOpen}
83-
>
84-
<Button
85-
aria-label={t('Open onboarding menu')}
86-
color="neutral"
87-
variant="tertiary"
88-
iconPosition="left"
89-
icon={
90-
<Icon
91-
$withThemeInherited
92-
iconName="help_outline"
93-
aria-hidden="true"
94-
/>
95-
}
96-
onClick={toggleMenu}
97-
/>
98-
</DropdownMenu>
99-
</Box>
100-
101-
<OnboardingModal
102-
isOpen={isModalOpen}
103-
appName={t('Docs')}
104-
mainTitle={t('Docs onboarding title')}
105-
steps={steps}
106-
hideContent
107-
onClose={closeModal}
108-
onComplete={closeModal}
109-
/>
110-
</>
111-
);
4+
return <OnBoarding />;
1125
};
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
88.2 KB
Loading
46.8 KB
Loading
44.7 KB
Loading
46.3 KB
Loading

0 commit comments

Comments
 (0)