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

@@ -33,7 +33,9 @@ export function ExpenseList({
expense.isReimbursement && 'italic',
)}
onClick={() => {
router.push(`/groups/${groupId}/expenses/${expense.id}/edit`)
router.push(`/groups/${groupId}/expenses/${expense.id}/edit`, {
scroll: false,
})
}}
>
<div>
@@ -66,7 +68,10 @@ export function ExpenseList({
{currency} {(expense.amount / 100).toFixed(2)}
</div>
<Button size="icon" variant="link" className="-my-2" asChild>
<Link href={`/groups/${groupId}/expenses/${expense.id}/edit`}>
<Link
href={`/groups/${groupId}/expenses/${expense.id}/edit`}
scroll={false}
>
<ChevronRight className="w-4 h-4" />
</Link>
</Button>