From b8d1d6334c8a698eee378d6fa097c7b0878d366f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Fri, 5 Nov 2021 12:45:30 +0100 Subject: [PATCH] Add Cart button and opening/closing transition --- src/components/atoms/CartButton.svelte | 19 +++++++++++++++++++ src/components/organisms/Cart.svelte | 23 +++++++++++++++++------ src/routes/shop/__layout.svelte | 22 +++++++++------------- src/style/organisms/_cart.scss | 11 +++++++++++ src/style/pages/_shop.scss | 15 ++++++++------- src/utils/store.ts | 5 +++++ 6 files changed, 69 insertions(+), 26 deletions(-) create mode 100644 src/components/atoms/CartButton.svelte create mode 100644 src/utils/store.ts diff --git a/src/components/atoms/CartButton.svelte b/src/components/atoms/CartButton.svelte new file mode 100644 index 0000000..8238a8a --- /dev/null +++ b/src/components/atoms/CartButton.svelte @@ -0,0 +1,19 @@ + + +
+ + + + + {#if $cartAmount > 0} + {$cartAmount} + {/if} +
\ No newline at end of file diff --git a/src/components/organisms/Cart.svelte b/src/components/organisms/Cart.svelte index b9fdd42..d52d820 100644 --- a/src/components/organisms/Cart.svelte +++ b/src/components/organisms/Cart.svelte @@ -1,18 +1,24 @@ - + +
\ No newline at end of file diff --git a/src/routes/shop/__layout.svelte b/src/routes/shop/__layout.svelte index 3e3dd82..7255664 100644 --- a/src/routes/shop/__layout.svelte +++ b/src/routes/shop/__layout.svelte @@ -1,9 +1,10 @@