From 5923afed3b8498d5d5e2aeea3bc9d51959bb5205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Sun, 7 Nov 2021 22:40:52 +0100 Subject: [PATCH] Make Shop location switcher a component using a global store Using two switchers (one in the shop nav and the other in the cart) makes possible to have the switcher over the Cart overlay (over intro) --- .../molecules/ShopLocationSwitcher.svelte | 33 ++++++++ src/components/organisms/Cart.svelte | 10 ++- src/routes/shop/__layout.svelte | 43 ++++++----- .../molecules/_shop-locationswitcher.scss | 43 +++++++++++ src/style/organisms/_cart.scss | 17 +++- src/style/pages/_shop.scss | 77 ++++--------------- src/style/style.scss | 1 + 7 files changed, 140 insertions(+), 84 deletions(-) create mode 100644 src/components/molecules/ShopLocationSwitcher.svelte create mode 100644 src/style/molecules/_shop-locationswitcher.scss diff --git a/src/components/molecules/ShopLocationSwitcher.svelte b/src/components/molecules/ShopLocationSwitcher.svelte new file mode 100644 index 0000000..c6529b9 --- /dev/null +++ b/src/components/molecules/ShopLocationSwitcher.svelte @@ -0,0 +1,33 @@ + + +
+
Shop your city
+
+ + + + +
+
\ No newline at end of file diff --git a/src/components/organisms/Cart.svelte b/src/components/organisms/Cart.svelte index e0101f4..9fa4b06 100644 --- a/src/components/organisms/Cart.svelte +++ b/src/components/organisms/Cart.svelte @@ -6,8 +6,7 @@ // Components import Button from '$components/atoms/Button.svelte' import CartItem from '$components/molecules/CartItem.svelte' - - let open = false + import ShopLocationSwitcher from '$components/molecules/ShopLocationSwitcher.svelte' onMount(async () => { @@ -99,6 +98,13 @@ {#if $cartOpen} +
+ +
+