Skip to content

Commit

Permalink
feat: Add a back to storage button on the shopping cart page
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroWave022 committed Sep 7, 2024
1 parent 5666ae1 commit bee1c23
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"location": "Location",
"unitsAvailable": "Units available",
"tableDescription": "A list of your shopping cart items.",
"backToStorage": "Back to storage",
"cartEmpty": "Your shopping cart is empty."
}
}
Expand Down
1 change: 1 addition & 0 deletions messages/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"location": "Plass",
"unitsAvailable": "Stk tilgjengelig",
"tableDescription": "En liste over handlekurven din.",
"backToStorage": "Tilbake til lageret",
"cartEmpty": "Handlekurven din er tom."
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/app/[locale]/(default)/storage/shopping-cart/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ShoppingCartTable } from '@/components/storage/ShoppingCartTable';
import ShoppingCartTableSkeleton from '@/components/storage/ShoppingCartTableSkeleton';
import { Button } from '@/components/ui/Button';
import { Link } from '@/lib/navigation';
import { ArrowLeft } from 'lucide-react';
import { useTranslations } from 'next-intl';
import { Suspense } from 'react';

Expand All @@ -21,6 +24,12 @@ export default function StorageShoppingCartPage() {
<Suspense fallback={<ShoppingCartTableSkeleton />}>
<ShoppingCartTable messages={tableMessages} />
</Suspense>
<Link href='/storage'>
<Button className='mx-auto flex gap-2'>
<ArrowLeft />
{t('backToStorage')}
</Button>
</Link>
</>
);
}

0 comments on commit bee1c23

Please sign in to comment.