feat: add dropdown for links and collection header

This commit is contained in:
Sonny
2024-05-13 00:04:01 +02:00
committed by Sonny
parent 0f1dc9b69c
commit 2f0e1dd375
13 changed files with 204 additions and 131 deletions

View File

@@ -1,13 +1,20 @@
import styled from '@emotion/styled';
import { ReactNode } from 'react';
import Footer from '~/components/footer/footer';
import Navbar from '../navbar/navbar';
import BaseLayout from './_base_layout';
const ContentLayoutStyle = styled.div(({ theme }) => ({
height: 'auto',
height: '100%',
width: theme.media.small_desktop,
maxWidth: '100%',
padding: '1em',
display: 'flex',
flexDirection: 'column',
'& main': {
flex: 1,
},
}));
const ContentLayout = ({ children }: { children: ReactNode }) => (
@@ -15,6 +22,7 @@ const ContentLayout = ({ children }: { children: ReactNode }) => (
<ContentLayoutStyle>
<Navbar />
<main>{children}</main>
<Footer />
</ContentLayoutStyle>
</BaseLayout>
);

View File

@@ -1,10 +1,11 @@
import PATHS from '#constants/paths';
import styled from '@emotion/styled';
import { Link } from '@inertiajs/react';
import { FormEvent, ReactNode } from 'react';
import Button from '~/components/common/form/_button';
import Form from '~/components/common/form/_form';
import BaseLayout from './_base_layout';
import { appendCollectionId } from '~/lib/navigation';
import PATHS from '#constants/paths';
const FormLayoutStyle = styled.div(({ theme }) => ({
height: 'fit-content',
@@ -26,6 +27,7 @@ interface FormLayoutProps {
textSubmitButton?: string;
disableHomeLink?: boolean;
collectionId?: string;
}
const FormLayout = ({
@@ -35,6 +37,7 @@ const FormLayout = ({
handleSubmit,
textSubmitButton = 'Confirm',
disableHomeLink = false,
collectionId,
}: FormLayoutProps) => (
<BaseLayout>
<FormLayoutStyle>
@@ -46,8 +49,9 @@ const FormLayout = ({
</Button>
</Form>
{!disableHomeLink && (
// <Link href={collectionId ? `/?collectionId=${collectionId}` : '/'}>{t('common:back-home')}</Link>
<Link href={PATHS.DASHBOARD}> Revenir à l'accueil</Link>
<Link href={appendCollectionId(PATHS.DASHBOARD, collectionId)}>
Back to home
</Link>
)}
</FormLayoutStyle>
</BaseLayout>