From fd4b12293689f252bde87b8f1a92bfb5658c5cf5 Mon Sep 17 00:00:00 2001 From: Arina Yakovenko Date: Mon, 30 Jun 2025 15:27:46 +0200 Subject: [PATCH] login/checkout --- app.vue | 2 +- assets/toastify-custom.css | 24 +++- components/CartPopup.vue | 8 +- components/CountryCurrencySelector.vue | 8 +- components/HeaderBlock.vue | 18 ++- components/section/CheckoutMain.vue | 140 +++++++++++++++------ components/section/LoginMain.vue | 57 +++------ components/ui/CheckoutInput.vue | 4 +- stores/checkoutStore.ts | 165 +++++++++++++------------ stores/userStore.ts | 105 +++++++++++----- types/checkout.ts | 17 +++ 11 files changed, 336 insertions(+), 212 deletions(-) diff --git a/app.vue b/app.vue index 1c8d689..e27eee2 100644 --- a/app.vue +++ b/app.vue @@ -10,5 +10,5 @@ diff --git a/assets/toastify-custom.css b/assets/toastify-custom.css index 7ca3de9..a7519d3 100644 --- a/assets/toastify-custom.css +++ b/assets/toastify-custom.css @@ -1,3 +1,4 @@ +/* ===== Base toast style (applies to all toasts) ===== */ .Toastify__toast { font-family: var(--font-inter); background-color: var(--color-bg-light); @@ -7,29 +8,44 @@ box-shadow: none; } +/* ===== Base toast style for dark mode ===== */ .dark .Toastify__toast { background-color: var(--color-bg-dark); border: 1px solid var(--color-block); color: #ffffff; } +/* ===== Error toast: red background and white text ===== */ .Toastify__toast--error { - background-color: #dc3545; - color: #fff; + background-color: var(--color-bg-light); } +/* ===== Error toast in dark mode: darker red background ===== */ .dark .Toastify__toast--error { - background-color: #c82333; + background-color: var(--color-bg-dark); } +/* ===== Default progress bar color (used for success and others) ===== */ .Toastify__progress-bar { background-color: var(--color-accent-green-dark); } +/* ===== Error toast: custom progress bar color ===== */ +.Toastify__toast--error .Toastify__progress-bar { + background-color: #dc3545; +} + +/* ===== Success toast: icon color ===== */ .Toastify__toast--success .Toastify__toast-icon svg { fill: var(--color-accent-green-dark); } +/* ===== Error toast: icon color ===== */ +.Toastify__toast--error .Toastify__toast-icon svg { + fill: #dc3545; +} + +/* ===== Close button color in dark mode ===== */ .dark .Toastify__close-button { color: #fff; - } \ No newline at end of file +} \ No newline at end of file diff --git a/components/CartPopup.vue b/components/CartPopup.vue index 5d9e217..c57a6e0 100644 --- a/components/CartPopup.vue +++ b/components/CartPopup.vue @@ -65,9 +65,11 @@ {{ productStore.cart.total_value }}
{{ $t("country") }}
{ $session.setCountry(item.iso_code); $session.loadSession(); dropCountry = false }" class="w-full hover:bg-block dark:hover:bg-button pl-2 py-2 text-base text-text-light dark:text-text-dark rounded-[5px]" @@ -35,7 +35,7 @@
{{ $t("currency") }}
{ $session.setCurrency(item.iso_code); $session.loadSession(); dropCurrency = false }" class="w-full hover:bg-block dark:hover:bg-button pl-1 py-2 text-base text-text-light dark:text-text-dark rounded-[5px]" diff --git a/components/HeaderBlock.vue b/components/HeaderBlock.vue index 903dc03..4db65a4 100644 --- a/components/HeaderBlock.vue +++ b/components/HeaderBlock.vue @@ -18,8 +18,15 @@
{ checkoutStore.selectedIso = item; dropIso = false; checkoutStore.changePrefix(item.call_prefix as string) }" + class="w-full hover:bg-block dark:hover:bg-button pl-2 py-2 text-base text-text-light dark:text-text-dark rounded-[5px]" + v-for="item in menuStore.countries" :key="item.iso_code"> + {{ item?.name }} +
{{ checkoutStore.currentPrefix }}
Invalid phone number
{{ $t('use_account_phone') }}
+ {{ $t("country") }} +
{ checkoutStore.vNewAddressCountry = item; dropCountry = false }" + class="w-full hover:bg-block dark:hover:bg-button pl-2 py-2 text-base text-text-light dark:text-text-dark rounded-[5px]" + v-for="item in menuStore.countries" :key="item.iso_code"> + {{ item?.name }} +
{{ $t('send_code') }} test@ma-al.com {{ +
{{ $t('send_code') }} {{ userStore.email }} {{ $t('by_email') }}
{{ $t('code') }}