mirror of
https://github.com/spliit-app/spliit.git
synced 2026-03-10 05:59:06 +01:00
First attemps at using route interception and modals
This commit is contained in:
30
src/app/groups/[groupId]/@modal/expense-modal.tsx
Normal file
30
src/app/groups/[groupId]/@modal/expense-modal.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
'use client'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import { ReactNode } from 'react'
|
||||
|
||||
export function ExpenseModal({
|
||||
children,
|
||||
title,
|
||||
}: {
|
||||
children: ReactNode
|
||||
title: ReactNode
|
||||
}) {
|
||||
const router = useRouter()
|
||||
|
||||
return (
|
||||
<Dialog open onOpenChange={() => router.back()}>
|
||||
<DialogContent className="w-full max-w-screen-sm">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{title}</DialogTitle>
|
||||
</DialogHeader>
|
||||
{children}
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user