From 06d147610d7308dbcc9176734a7709d0e5f4bb2a Mon Sep 17 00:00:00 2001 From: Krecik Date: Mon, 12 Oct 2020 15:39:12 +0200 Subject: [PATCH] fix(default-theme): add currency switcher on mobile (#1165) --- .../default-theme/components/SwBottomMenu.vue | 19 +-- .../components/SwBottomMoreActions.vue | 159 ++++++++++++++++++ .../components/SwBottomNavigation.vue | 52 +++--- 3 files changed, 199 insertions(+), 31 deletions(-) create mode 100644 packages/default-theme/components/SwBottomMoreActions.vue diff --git a/packages/default-theme/components/SwBottomMenu.vue b/packages/default-theme/components/SwBottomMenu.vue index 9fc0d8660..42fb42394 100644 --- a/packages/default-theme/components/SwBottomMenu.vue +++ b/packages/default-theme/components/SwBottomMenu.vue @@ -1,23 +1,24 @@ @@ -116,12 +128,10 @@ import { SfMenuItem, } from "@storefront-ui/vue" import { useUIState, useUser, useCart } from "@shopware-pwa/composables" -import SwCurrencySwitcher from "@/components/SwCurrencySwitcher" -import { onMounted } from "@vue/composition-api" -import SwButton from "@/components/atoms/SwButton" import SwBottomMenu from "@/components/SwBottomMenu" import { PAGE_ACCOUNT } from "@/helpers/pages" import { getCategoryUrl } from "@shopware-pwa/helpers" +import SwBottomMoreActions from "@/components/SwBottomMoreActions" export default { name: "SwBottomNavigation", @@ -130,16 +140,16 @@ export default { SfIcon, SfCircleIcon, SfBottomModal, - SwCurrencySwitcher, - SwButton, SwBottomMenu, SfList, SfMenuItem, + SwBottomMoreActions, }, data() { return { mobileNavIsActive: false, userIconActive: false, + moreActionsIsActive: false, } }, setup(props, { root }) { @@ -161,16 +171,16 @@ export default { count, } }, - watch: { - $route() { - this.userIconActive = false - }, - }, computed: { getPageAccount() { return PAGE_ACCOUNT }, }, + watch: { + $route() { + this.userIconActive = false + }, + }, methods: { userIconClick() { if (this.isLoggedIn) { @@ -187,6 +197,9 @@ export default { toggleMobileNavigation() { this.mobileNavIsActive = !this.mobileNavIsActive }, + toggleMoreActions() { + this.moreActionsIsActive = !this.moreActionsIsActive + }, }, } @@ -206,15 +219,10 @@ export default { min-width: 2rem; } } + .menu-button { position: relative; - &__currency { - --select-padding: 0; - --select-height: 2rem; - --select-color: #afb0b6; - } - &__select { --chevron-size: 0; --select-margin: 0; @@ -257,5 +265,9 @@ export default { } } } + + .more-actions { + margin-bottom: var(--spacer-xs); + } }