Skip to content

Open source personal finance application

feat: add Toastify styles and improve component class structures

Ilya Komichev6ab911ea68bf
diff --git a/app/assets/css/others.css b/app/assets/css/others.css
new file mode 100644
index 00000000..66bd4768
--- /dev/null
+++ b/app/assets/css/others.css
@@ -0,0 +1,15 @@
+.Toastify__toast {
+ @apply cursor-default bg-foreground-1 !ring-2 !ring-item-3 text-1 p-0 min-h-6 rounded-lg hover:bg-item-3;
+}
+
+.Toastify__toast-body {
+ @apply p-5 py-5;
+}
+
+.Toastify__close-button {
+ @apply text-1;
+}
+
+.Toastify__progress-bar {
+ @apply hidden;
+}
diff --git a/app/assets/css/theme.css b/app/assets/css/theme.css
index a5ef5db1..fba0d7c1 100644
--- a/app/assets/css/theme.css
+++ b/app/assets/css/theme.css
@@ -1,3 +1,5 @@
+@import 'others.css';
+
html {
--hue: 220deg;
--c-blue-1: hsl(220, 100%, 61%);
diff --git a/app/components/date/LinkItem.vue b/app/components/date/LinkItem.vue
index 3bf5dd8f..91177465 100644
--- a/app/components/date/LinkItem.vue
+++ b/app/components/date/LinkItem.vue
@@ -17,7 +17,7 @@ const emit = defineEmits<{
'_!bg-item-5 text-accent-1': props.isActive,
},
]"
- class="font-primary text-nowrap rounded-full text-xs leading-none"
+ class="text-nowrap rounded-full font-primary text-xs leading-none"
@click="(e: Event) => emit('click', e)"
>
<slot />
diff --git a/app/components/stat/CategoriesButtons.vue b/app/components/stat/CategoriesButtons.vue
index d8b0734a..798346ca 100644
--- a/app/components/stat/CategoriesButtons.vue
+++ b/app/components/stat/CategoriesButtons.vue
@@ -194,7 +194,7 @@ const isShow = ref(false)
<template #content="{ close }">
<div class="grid min-w-80 gap-4 px-1 pt-3 md:px-3">
<BottomSheetClose @click="close" />
- <div class="border-item-3 grid gap-4 border-b pb-3">
+ <div class="grid gap-4 border-b border-item-3 pb-3">
<!-- Grouping -->
<div class="grid gap-3">
<UiTitleOption>
@@ -264,7 +264,7 @@ const isShow = ref(false)
<!-- List -->
<div
v-if="statConfig.config.value.catsView === 'list'"
- class="border-item-3 grid gap-3 border-b pb-2 last:border-0"
+ class="grid gap-3 border-b border-item-3 pb-2 last:border-0"
>
<UiTitleOption>{{ t('listItemsOptions') }}</UiTitleOption>
<div class="flex gap-1">
@@ -346,7 +346,7 @@ const isShow = ref(false)
<!-- Vertical -->
<div
v-if="props.catsLength > 1"
- class="border-item-3 grid border-b pb-2 last:border-0 md:pb-0"
+ class="grid border-b border-item-3 pb-2 last:border-0 md:pb-0"
>
<UiTitleOption class="pb-2">
{{ t('stat.config.categories.vertical.label') }}
@@ -402,7 +402,7 @@ const isShow = ref(false)
<!-- TODO: use StatConfig -->
<div
v-if="false"
- class="border-item-3 border-b pb-2 last:border-0 last:pb-0"
+ class="border-b border-item-3 pb-2 last:border-0 last:pb-0"
>
<!-- Favorite -->
<UiElement
diff --git a/app/components/stat/Config.vue b/app/components/stat/Config.vue
index d79de85c..7df2aeee 100644
--- a/app/components/stat/Config.vue
+++ b/app/components/stat/Config.vue
@@ -40,7 +40,7 @@ const isShow = ref(false)
<BottomSheetClose @click="close" />
<!-- Chart -->
- <div class="border-item-3 border-b pb-3">
+ <div class="border-b border-item-3 pb-3">
<UiTitleOption class="pb-2">
{{ t('stat.config.chartShow.title') }}
</UiTitleOption>
@@ -108,7 +108,7 @@ const isShow = ref(false)
<!-- Showed wallets -->
<div
v-if="props.isShowWallets"
- class="border-item-3 border-b pb-3"
+ class="border-b border-item-3 pb-3"
>
<UiTitleOption class="pb-2">
{{ t('stat.config.wallets.title') }}
diff --git a/app/components/ui/ButtonWithRight.vue b/app/components/ui/ButtonWithRight.vue
index c73dff73..43567add 100644
--- a/app/components/ui/ButtonWithRight.vue
+++ b/app/components/ui/ButtonWithRight.vue
@@ -9,7 +9,7 @@ const emit = defineEmits<{
insideClasses="max-w-lg w-full !min-h-[44px] bg-item-4 px-2 @xs/element:pl-4 @xs/element:pr-3 block @xs/element:flex @xs/element:flex-wrap gap-0 gap-x-2"
@click="(e: Event) => emit('click', e)"
>
- <div class="text-2 text-sm">
+ <div class="text-sm text-2">
<slot name="label" />
</div>
diff --git a/app/components/ui/Element.vue b/app/components/ui/Element.vue
index 0ef74899..a68d0465 100644
--- a/app/components/ui/Element.vue
+++ b/app/components/ui/Element.vue
@@ -49,7 +49,7 @@ const classes = computed(() => cn(
'ml-[48px] group-last/item:hidden': lineWidth === 4,
'group-last:hidden': lineWidth !== 3 && lineWidth !== 4,
}"
- class="bg-item-5 mx-2 h-px"
+ class="mx-2 h-px bg-item-5"
/>
</div>
</template>
diff --git a/app/components/ui/Item1.vue b/app/components/ui/Item1.vue
index 5cdc5f3d..8d62e7b6 100644
--- a/app/components/ui/Item1.vue
+++ b/app/components/ui/Item1.vue
@@ -9,7 +9,7 @@ const emit = defineEmits<{
<template>
<div
:class="getStyles('item', ['link', '_bg', 'center', 'minh2', 'minw1', 'rounded'])"
- class="group-data-[headlessui-state='open']:!bg-item-3 justify-center text-xl"
+ class="justify-center text-xl group-data-[headlessui-state='open']:!bg-item-3"
@click="(e: Event) => emit('click', e)"
>
<slot />
diff --git a/app/components/wallets/List.vue b/app/components/wallets/List.vue
index bac886d3..4fd26620 100644
--- a/app/components/wallets/List.vue
+++ b/app/components/wallets/List.vue
@@ -52,7 +52,7 @@ onMounted(() => stateLimit.value = props.limit)
>
<div
:class="getStyles('item', ['rounded', 'minh1', 'link', 'padding1', 'center3'])"
- class="text-2 -mt-px text-xs"
+ class="-mt-px text-xs text-2"
@click="toggle"
>
<template v-if="stateLimit > 0">
diff --git a/app/components/wallets/page/List.vue b/app/components/wallets/page/List.vue
index a42e310b..62b211a5 100644
--- a/app/components/wallets/page/List.vue
+++ b/app/components/wallets/page/List.vue
@@ -550,7 +550,7 @@ const counts = computed(() => ({
</div>
</template>
- <div class="border-item-5 ml-5 -translate-x-px border-l pl-3">
+ <div class="ml-5 -translate-x-px border-l border-item-5 pl-3">
<template v-if="groupedOptions.currencies === 0">
<WalletsItem
v-for="walletId in walletsIds"
@@ -592,7 +592,7 @@ const counts = computed(() => ({
</div>
</template>
- <div class="border-item-5 ml-5 -translate-x-px border-l pl-3">
+ <div class="ml-5 -translate-x-px border-l border-item-5 pl-3">
<WalletsItem
v-for="walletId in groupedWalletsIds"
:key="walletId"
@@ -640,7 +640,7 @@ const counts = computed(() => ({
</div>
</template>
- <div class="border-item-5 ml-5 -translate-x-px border-l pl-3">
+ <div class="ml-5 -translate-x-px border-l border-item-5 pl-3">
<template v-if="groupedOptions.type === 0">
<WalletsItem
v-for="walletId in walletsIds"
@@ -691,7 +691,7 @@ const counts = computed(() => ({
</div>
</template>
- <div class="border-item-5 ml-5 -translate-x-px border-l pl-3">
+ <div class="ml-5 -translate-x-px border-l border-item-5 pl-3">
<WalletsItem
v-for="walletId in groupedWalletsIds"
:key="walletId"
diff --git a/app/plugins/toast.ts b/app/plugins/toast.ts
index 32b53060..0d2439f0 100644
--- a/app/plugins/toast.ts
+++ b/app/plugins/toast.ts
@@ -1,15 +1,19 @@
import Vue3Toastify, { toast } from 'vue3-toastify'
+
+import BottomSheetClose from '~/components/bottomSheet/BottomSheetClose'
+
import 'vue3-toastify/dist/index.css'
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(Vue3Toastify, {
- autoClose: 5000,
- closeButton: false,
+ autoClose: 500000,
+ closeButton: BottomSheetClose,
+ hideProgressBar: true,
icon: false,
limit: 3,
multiple: true,
position: toast.POSITION.TOP_LEFT,
- theme: 'auto',
+ theme: 'dark',
transition: 'zoom',
})