mirror of
https://github.com/spliit-app/spliit.git
synced 2026-03-09 21:49:06 +01:00
First attemps at using route interception and modals
This commit is contained in:
@@ -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 }} />
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user