Open source personal finance application
chore: refactor
ilkomeb4a9bcdcfde3
diff --git a/components/layout/Modals.vue b/components/layout/Modals.vueindex 391a30dd..574d6708 100644--- a/components/layout/Modals.vue+++ b/components/layout/Modals.vue@@ -13,7 +13,7 @@ export default defineComponent({<template lang="pug">.h-0- //- trn: form+ //- TrnFormBaseBottomSheet(keepAlive:show="$store.getters['wallets/hasWallets'] && $store.getters['categories/hasCategories'] && $store.state.trnForm.show"@@ -24,38 +24,15 @@ export default defineComponent({BaseBottomSheetClose(@onClick="close")TrnForm(:show="$store.getters['wallets/hasWallets'] && $store.getters['categories/hasCategories'] && $store.state.trnForm.show")- //- trn: item+ //- Trn ItemTrnsModal- //- currencies+ //- CurrenciesCurrenciesModal//- category: create or editLazyCategoriesEditModal(v-if="activeTab === 'createCategory'")- //- wallet: create or edit- Portal(v-if="activeTab === 'createWallet'" to="modal")- ModalBottom(- :key="$store.state.wallets.editId"- @onClose="$store.dispatch('ui/setActiveTab', null)"- )- WalletsFormWalletForm(- @callback="$store.dispatch('ui/setActiveTab', null)"- )-- //- wallet: sort- Portal(v-if="activeTab === 'walletsSort'" to="modal" key="walletsSort")- ModalBottom(- isShow- key="walletsSort"- @onClose="$store.dispatch('ui/setActiveTab', null)"- )- template(#default="{ closeModal }")- WalletsSort(- v-if="activeTab === 'walletsSort'"- @closeModal="closeModal"- )-//- loadingtemplate(v-if="!$store.state.app.status.ready")LoaderSharedLoaderdiff --git a/components/shared/copyright/Copyright.vue b/components/shared/copyright/Copyright.vueindex ed85e68a..2d914b33 100644--- a/components/shared/copyright/Copyright.vue+++ b/components/shared/copyright/Copyright.vue@@ -5,7 +5,7 @@ export default {</script><template lang="pug">-a.copyright.py-1.px-5.rounded-md(+a.copyright.py-3.px-5.rounded-md(href="https://ilko.me"class="hocus_bg-white2 dark_hocus_bg-custom1")diff --git a/components/stat/NoStatActions.vue b/components/stat/NoStatActions.vueindex 02b3b0f1..8afeca77 100644--- a/components/stat/NoStatActions.vue+++ b/components/stat/NoStatActions.vue@@ -1,61 +1,31 @@-<script>-export default {- name: 'StatNoStatActions',-}+<script setup lang="ts">+const { $store } = useNuxtApp()+const router = useRouter()++if (!$store.getters['wallets/hasWallets'] || !$store.getters['categories/hasCategories'])+ router.replace('/welcome')</script><template lang="pug">-.startSomething- .options__item(v-if="$store.getters['wallets/hasWallets'] && $store.getters['categories/hasCategories']")- SharedButton._grey._center(- :title="$t('createTrn')"- @onClick="$store.dispatch('trnForm/openTrnForm', { action: 'create' })"- )-- .options__item(v-if="!$store.getters['wallets/hasWallets'] && !$store.getters['categories/hasCategories']")- .options__text {{ $t('welcome.firstRun.text') }}+.h-full.p-4.flex-center.flex-col(v-if="$store.getters['wallets/hasWallets'] && $store.getters['categories/hasCategories']")+ .pb-4.text-skin-item-base-up.text-xl {{ $t('intro') }}- SharedButton._text-center._blue2(- :title="$t('welcome.firstRun.btn')"- @onClick="$router.push('/welcome')"- )+ SharedButton._text-center._blue2(+ :title="$t('create')"+ @onClick="$store.dispatch('trnForm/openTrnForm', { action: 'create' })"+ )</template>-<style lang="stylus" scoped>-.startSomething- display flex- align-items center- justify-content center- padding 100px 0- flex-flow column-- .options__item- margin-bottom 40px- padding 0 $m6-- .options__text- padding-bottom $m8- text-align center-- .options__or- position relative- display flex- align-items center- justify-content center- padding $m9 0- color var(--c-font-3)- text-align center-- &__text- position relative- padding $m7- background var(--c-bg-3)-- &__border- position absolute- top 50%- left 0- width 100%- height 1px- background var(--c-bg-6)-</style>+<i18n lang="json5">+{+ "en": {+ "intro": "To see Statistics",+ "create": "Create your first Transaction",+ },++ "ru": {+ "intro": "Чтобы увидеть статистику",+ "create": "Создайте свою первую Транзакцию",+ }+}+</i18n>diff --git a/pages/welcome.vue b/pages/welcome.vueindex 9f813618..852f99a9 100644--- a/pages/welcome.vue+++ b/pages/welcome.vue@@ -1,6 +1,5 @@<script>export default {- name: 'WelcomePage',layout: 'welcome',data() {@@ -127,7 +126,7 @@ export default {@onClick="step = 3")- //- wallet+ //- Wallettransition(name="fadeIn")template(v-if="(step !== 1 && step !== 2) && !showWalletForm && !$store.getters['wallets/hasWallets']").tab@@ -141,7 +140,14 @@ export default {@onClick="showWalletForm = true")- //- category+ //- Wallet form+ transition(name="fadeIn")+ WalletsFormWelcome(+ v-if="showWalletForm"+ :saved="() => showWalletForm = false"+ )++ //- Categorytransition(name="fadeIn")template(v-if="(step !== 1 && step !== 2) && !showWalletForm && !showCategoryForm && $store.getters['wallets/hasWallets'] && !$store.getters['categories/hasCategories']").tab@@ -152,21 +158,24 @@ export default {:title="$t('welcome.createFirstCategory.btn')"@onClick="showCategoryForm = true")- transition(name="fadeIn")- .tab(v-if="showWalletForm")- .tab__content- WalletsFormWalletForm(@callback="showWalletForm = false")-transition(name="fadeIn").tab(v-if="showCategoryForm").tab__contentLazyCategoriesForm(@callback="categoryCreatedCallback")- .copyright+ .firefoxBackdropFix.z-10.w-full.fixed.left-0.bottom-0.backdrop-blur(+ class="bg-white/70 dark_bg-dark3/70"+ )SharedCopyright</template><style lang="stylus" scoped>+.firefoxBackdropFix+ @supports (not (-webkit-backdrop-filter: none)) and (not (backdrop-filter: none))+ background theme('colors.dark3') !important+ /.light &+ background theme('colors.white') !important+.stepsdisplay flexwidth 100%@@ -289,16 +298,6 @@ export default {@media $media-laptoppadding-bottom $m7-.copyright- position fixed- left 0- bottom 0- width 100%- padding-bottom $m7-- @media $media-laptop- padding-bottom $m9-.themeSelectorposition relativedisplay grid