mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 07:25:35 +00:00
feat: add dropdown for links and collection header
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user