🎨(app-desk) box default direction column

Change the default direction of the Box component to column
to have a behavior closer to a normal div.
This commit is contained in:
Anthony LC
2024-02-13 16:03:25 +01:00
committed by Anthony LC
parent 9981b9c615
commit 148ea81aa9
5 changed files with 17 additions and 11 deletions

View File

@@ -7,12 +7,11 @@ export default function InnerLayout({
children: React.ReactNode; children: React.ReactNode;
}) { }) {
return ( return (
<Box as="main" $direction="column" $height="100vh" $css="overflow:hidden;"> <Box as="main" $height="100vh" $css="overflow:hidden;">
<Header /> <Header />
<Box $css="flex: 1;"> <Box $css="flex: 1;" $direction="row">
<Menu /> <Menu />
<Box <Box
$direction="column"
$height={`calc(100vh - ${HEADER_HEIGHT})`} $height={`calc(100vh - ${HEADER_HEIGHT})`}
$width="100%" $width="100%"
$css="overflow: auto;" $css="overflow: auto;"

View File

@@ -9,7 +9,7 @@ export default function Home() {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<Box $direction="column" className="p-b"> <Box className="p-b">
<h1>{t('Hello Desk !')}</h1> <h1>{t('Hello Desk !')}</h1>
<Teams /> <Teams />
</Box> </Box>

View File

@@ -21,6 +21,7 @@ export interface BoxProps {
export const Box = styled('div')<BoxProps>` export const Box = styled('div')<BoxProps>`
display: flex; display: flex;
flex-direction: column;
${({ $align }) => $align && `align-items: ${$align};`} ${({ $align }) => $align && `align-items: ${$align};`}
${({ $background }) => $background && `background: ${$background};`} ${({ $background }) => $background && `background: ${$background};`}
${({ $color }) => $color && `color: ${$color};`} ${({ $color }) => $color && `color: ${$color};`}

View File

@@ -42,16 +42,21 @@ export const Header = () => {
return ( return (
<StyledHeader> <StyledHeader>
<RedStripe /> <RedStripe />
<Box className="ml-bx mr-bx" $align="center" $justify="space-between"> <Box
<Box $direction="column"> className="ml-bx mr-bx"
$align="center"
$justify="space-between"
$direction="row"
>
<Box>
<Image priority src={IconMarianne} alt={t('Marianne Logo')} /> <Image priority src={IconMarianne} alt={t('Marianne Logo')} />
<Box $align="center" $gap="6rem"> <Box $align="center" $gap="6rem" $direction="row">
<Image <Image
priority priority
src={IconGouv} src={IconGouv}
alt={t('Freedom Equality Fraternity Logo')} alt={t('Freedom Equality Fraternity Logo')}
/> />
<Box $align="center" $gap="1rem"> <Box $align="center" $gap="1rem" $direction="row">
<Image priority src={IconDesk} alt={t('Desk Logo')} /> <Image priority src={IconDesk} alt={t('Desk Logo')} />
<Text className="m-0" as="h2"> <Text className="m-0" as="h2">
{t('Desk')} {t('Desk')}
@@ -68,18 +73,20 @@ export const Header = () => {
`} `}
$gap="5rem" $gap="5rem"
$justify="flex-end" $justify="flex-end"
$direction="row"
> >
<Box $align="center"> <Box $align="center" $direction="row">
<Button <Button
aria-label={t('Access to FAQ')} aria-label={t('Access to FAQ')}
icon={<Image priority src={IconFAQ} alt={t('FAQ Icon')} />} icon={<Image priority src={IconFAQ} alt={t('FAQ Icon')} />}
className="m-s c__button-no-bg p-0" className="m-s c__button-no-bg p-0"
color="tertiary"
> >
{t('FAQ')} {t('FAQ')}
</Button> </Button>
<LanguagePicker /> <LanguagePicker />
</Box> </Box>
<Box> <Box $direction="row">
<Box $direction="row" $align="center" $gap="1rem"> <Box $direction="row" $align="center" $gap="1rem">
<Text $weight="bold">John Doe</Text> <Text $weight="bold">John Doe</Text>
<Image <Image

View File

@@ -23,7 +23,6 @@ export const Menu = () => {
$height="100%" $height="100%"
$width="3.75rem" $width="3.75rem"
$justify="space-between" $justify="space-between"
$direction="column"
> >
<Box className="pt-b" $direction="column" $gap="0.8rem"> <Box className="pt-b" $direction="column" $gap="0.8rem">
<MenuItem Icon={IconSearch} label={t('Search')} href="/" /> <MenuItem Icon={IconSearch} label={t('Search')} href="/" />