Skip to content

Commit d34f279

Browse files
committed
📱(frontend) improve mobile design left panel
Improve the onboarding modal design for mobile devices. Improve as well the left panel on mobile devices to fit more with the Figma design.
1 parent 3eed542 commit d34f279

File tree

3 files changed

+39
-15
lines changed

3 files changed

+39
-15
lines changed

src/frontend/apps/impress/src/features/help/components/HelpMenu.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { Button, useModal } from '@gouvfr-lasuite/cunningham-react';
1+
import {
2+
Button,
3+
ButtonProps,
4+
useModal,
5+
} from '@gouvfr-lasuite/cunningham-react';
26
import { DropdownMenu } from '@gouvfr-lasuite/ui-kit';
37
import { useCallback, useMemo, useState } from 'react';
48
import { useTranslation } from 'react-i18next';
@@ -12,7 +16,11 @@ import WandAndStarsIcon from '../assets/wand-and-stars.svg';
1216

1317
import { OnBoarding } from './OnBoarding';
1418

15-
export const HelpMenu = () => {
19+
export const HelpMenu = ({
20+
colorButton,
21+
}: {
22+
colorButton?: ButtonProps['color'];
23+
}) => {
1624
const { t } = useTranslation();
1725
const [isMenuOpen, setIsMenuOpen] = useState(false);
1826
const modalOnbording = useModal();
@@ -53,7 +61,7 @@ export const HelpMenu = () => {
5361
<Box $direction="row" $align="center">
5462
<Button
5563
aria-label={t('Open onboarding menu')}
56-
color="neutral"
64+
color={colorButton || 'neutral'}
5765
variant="tertiary"
5866
iconPosition="left"
5967
icon={<HelpOutlineIcon aria-hidden="true" />}

src/frontend/apps/impress/src/features/help/components/OnBoarding.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,20 @@ const OnBoardingStyle = createGlobalStyle`
5050
background-color: var(--c--contextuals--border--surface--primary);
5151
}
5252
53+
@media (max-width: 768px) {
54+
.c__modal__scroller {
55+
height: 100vh;
56+
display: flex;
57+
flex-direction: column;
58+
59+
& .c__onboarding-modal__body{
60+
justify-content: center;
61+
}
62+
& .c__onboarding-modal__content {
63+
height:auto;
64+
}
65+
}
66+
}
5367
`;
5468

5569
type OnBoardingProps = {

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useTranslation } from 'react-i18next';
22
import { createGlobalStyle, css } from 'styled-components';
33

4-
import { Box, SeparatedSection } from '@/components';
4+
import { Box, HorizontalSeparator, SeparatedSection } from '@/components';
55
import { useConfig } from '@/core/config/api/useConfig';
66
import { useCunninghamTheme } from '@/cunningham';
77
import { ButtonLogin } from '@/features/auth';
@@ -74,6 +74,7 @@ export const LeftPanel = () => {
7474
{isPanelOpenState && <MobileLeftPanelStyle />}
7575
<Box
7676
$hasTransition
77+
$height="100vh"
7778
$css={css`
7879
z-index: 999;
7980
width: 100dvw;
@@ -97,25 +98,26 @@ export const LeftPanel = () => {
9798
align-items: center;
9899
gap: ${spacingsTokens['base']};
99100
`}
101+
$height="inherit"
100102
>
101103
<LeftPanelHeader />
102104
<LeftPanelContent />
103-
{showHelpMenu && (
105+
<Box $width="100%">
106+
<HorizontalSeparator $margin="none" />
104107
<SeparatedSection showSeparator={false}>
105108
<Box
106-
$padding={{ horizontal: 'sm', vertical: 'xs' }}
107-
$justify="flex-start"
109+
$justify="end"
110+
$align="center"
111+
$gap={spacingsTokens['xs']}
112+
$direction="row"
113+
$padding={{ horizontal: 'sm' }}
108114
>
109-
<HelpMenu />
115+
<HelpMenu colorButton="brand" />
116+
<ButtonLogin />
117+
<LanguagePicker />
110118
</Box>
111119
</SeparatedSection>
112-
)}
113-
<SeparatedSection showSeparator={false}>
114-
<Box $justify="center" $align="center" $gap={spacingsTokens['sm']}>
115-
<ButtonLogin />
116-
<LanguagePicker />
117-
</Box>
118-
</SeparatedSection>
120+
</Box>
119121
</Box>
120122
</Box>
121123
</>

0 commit comments

Comments
 (0)