fixed all back buttons

This commit is contained in:
duffyduck 2026-03-21 12:03:32 +01:00
parent f2876f877e
commit a9643206bb
4 changed files with 6 additions and 6 deletions

View File

@ -1428,7 +1428,7 @@ export default function ContractDetail() {
return (
<div>
<div className="flex items-center gap-4 mb-6">
<Button variant="ghost" size="sm" onClick={() => navigate(-1)}>
<Button variant="ghost" size="sm" onClick={() => navigate(isCustomerPortal ? '/contracts' : (c.customer ? `/customers/${c.customer.id}?tab=contracts` : '/contracts'))}>
<ArrowLeft className="w-4 h-4" />
</Button>
<h1 className="text-2xl font-bold">Vertrag {c.contractNumber}</h1>
@ -1463,7 +1463,7 @@ export default function ContractDetail() {
<Button
variant="ghost"
size="sm"
onClick={() => navigate(-1)}
onClick={() => navigate(isCustomerPortal ? '/contracts' : (c.customer ? `/customers/${c.customer.id}?tab=contracts` : '/contracts'))}
>
<ArrowLeft className="w-4 h-4" />
</Button>

View File

@ -656,7 +656,7 @@ export default function ContractForm() {
return (
<div>
<div className="flex items-center gap-4 mb-6">
<Button variant="ghost" size="sm" onClick={() => navigate(-1)}>
<Button variant="ghost" size="sm" onClick={() => navigate(isEdit ? `/contracts/${id}` : '/contracts')}>
<ArrowLeft className="w-4 h-4" />
</Button>
<h1 className="text-2xl font-bold">
@ -1407,7 +1407,7 @@ export default function ContractForm() {
</Card>
<div className="flex justify-end gap-4">
<Button type="button" variant="secondary" onClick={() => navigate(-1)}>
<Button type="button" variant="secondary" onClick={() => navigate(isEdit ? `/contracts/${id}` : '/contracts')}>
Abbrechen
</Button>
<Button type="submit" disabled={isLoading}>

View File

@ -202,7 +202,7 @@ export default function CustomerDetail({ portalCustomerId }: { portalCustomerId?
<div>
<div className="flex items-center justify-between mb-6">
<div className="flex items-center gap-3">
<Button variant="ghost" size="sm" onClick={() => navigate(-1)}>
<Button variant="ghost" size="sm" onClick={() => navigate(isCustomerPortal ? '/' : '/customers')}>
<ArrowLeft className="w-4 h-4" />
</Button>
<div>

View File

@ -232,7 +232,7 @@ export default function CustomerForm() {
</Card>
<div className="flex justify-end gap-4">
<Button type="button" variant="secondary" onClick={() => navigate(-1)}>
<Button type="button" variant="secondary" onClick={() => navigate(isEdit ? `/customers/${id}` : '/customers')}>
Abbrechen
</Button>
<Button type="submit" disabled={isLoading}>