Use modal dialogs for expense creation & edition (#10)

* First attemps at using route interception and modals

* Remove route interception

* Make it work

* Use Vaul on small screens

* Improve vaul
This commit is contained in:
Sebastien Castiel
2023-12-19 09:36:40 -05:00
committed by GitHub
parent 66ab0ff82b
commit 1e66efe516
18 changed files with 630 additions and 318 deletions

View File

@@ -5,12 +5,13 @@ import { getGroup } from '@/lib/api'
import { Metadata } from 'next'
import Link from 'next/link'
import { notFound } from 'next/navigation'
import { PropsWithChildren } from 'react'
import { PropsWithChildren, ReactNode } from 'react'
type Props = {
params: {
groupId: string
}
modal: ReactNode
}
export async function generateMetadata({
@@ -28,6 +29,7 @@ export async function generateMetadata({
export default async function GroupLayout({
children,
modal,
params: { groupId },
}: PropsWithChildren<Props>) {
const group = await getGroup(groupId)
@@ -47,6 +49,7 @@ export default async function GroupLayout({
</div>
{children}
{modal}
<SaveGroupLocally group={{ id: group.id, name: group.name }} />
</>