From 27180b1875bbafbe745160f1c619263c4bba73a3 Mon Sep 17 00:00:00 2001 From: ZeroWave022 <36341766+ZeroWave022@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:38:43 +0200 Subject: [PATCH] feat: Add clear cart button --- messages/en.json | 3 ++- messages/no.json | 3 ++- .../(default)/storage/shopping-cart/page.tsx | 16 ++++++----- .../storage/ShoppingCartClearButton.tsx | 27 +++++++++++++++++++ 4 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 src/components/storage/ShoppingCartClearButton.tsx diff --git a/messages/en.json b/messages/en.json index 89ab309..2cc988a 100644 --- a/messages/en.json +++ b/messages/en.json @@ -84,7 +84,8 @@ "unitsAvailable": "Units available", "tableDescription": "A list of your shopping cart items.", "backToStorage": "Back to storage", - "cartEmpty": "Your shopping cart is empty." + "cartEmpty": "Your shopping cart is empty.", + "clearCart": "Empty shopping cart" } } } diff --git a/messages/no.json b/messages/no.json index 80953f0..829331a 100644 --- a/messages/no.json +++ b/messages/no.json @@ -84,7 +84,8 @@ "unitsAvailable": "Stk tilgjengelig", "tableDescription": "En liste over handlekurven din.", "backToStorage": "Tilbake til lageret", - "cartEmpty": "Handlekurven din er tom." + "cartEmpty": "Handlekurven din er tom.", + "clearCart": "Tøm handlekurven" } } } diff --git a/src/app/[locale]/(default)/storage/shopping-cart/page.tsx b/src/app/[locale]/(default)/storage/shopping-cart/page.tsx index f2f08d8..62627cc 100644 --- a/src/app/[locale]/(default)/storage/shopping-cart/page.tsx +++ b/src/app/[locale]/(default)/storage/shopping-cart/page.tsx @@ -1,3 +1,4 @@ +import { ShoppingCartClearButton } from '@/components/storage/ShoppingCartClearButton'; import { ShoppingCartTable } from '@/components/storage/ShoppingCartTable'; import { Button } from '@/components/ui/Button'; import { Link } from '@/lib/navigation'; @@ -26,12 +27,15 @@ export default function StorageShoppingCartPage({ <>