Skip to content

Open source personal finance application

feat: enhance Welcome component with dynamic introductory text

Ilya Komichev6261830e963b
diff --git a/app/components/app/Welcome.vue b/app/components/app/Welcome.vue
index 66d50698..e909f096 100644
--- a/app/components/app/Welcome.vue
+++ b/app/components/app/Welcome.vue
@@ -8,15 +8,27 @@ const router = useRouter()
const walletsStore = useWalletsStore()
const categoriesStore = useCategoriesStore()
const trnsFormStore = useTrnsFormStore()
+
+const introText = computed(() => {
+ if (!walletsStore.hasItems) {
+ return t('introWallets')
+ }
+
+ if (!categoriesStore.hasItems) {
+ return t('introCategories')
+ }
+
+ return t('intro')
+})
</script>
<template>
- <div class="flex h-full items-center justify-center">
+ <UiPage class="flex h-full items-center justify-center">
<div
class="flex-center h-full flex-col pt-10"
>
<UiTitle3 class="pb-4">
- {{ t('intro') }}
+ {{ introText }}
</UiTitle3>
<UiButtonAccent
@@ -24,7 +36,7 @@ const trnsFormStore = useTrnsFormStore()
rounded
@click="router.push('/wallets/new')"
>
- {{ t("wallets.new") }}
+ {{ t('wallets.new') }}
</UiButtonAccent>
<UiButtonAccent
@@ -32,7 +44,7 @@ const trnsFormStore = useTrnsFormStore()
rounded
@click="router.push('/categories/new')"
>
- {{ t("categories.new") }}
+ {{ t('categories.new') }}
</UiButtonAccent>
<UiButtonAccent
@@ -40,20 +52,24 @@ const trnsFormStore = useTrnsFormStore()
rounded
@click="trnsFormStore.trnFormCreate()"
>
- {{ t("createTrn") }}
+ {{ t('createTrn') }}
</UiButtonAccent>
</div>
- </div>
+ </UiPage>
</template>
<i18n lang="yaml">
en:
intro: To see statistics
+ introWallets: To see statistics add your first Wallet
+ introCategories: To see statistics add your first Category
createTrn: Create your first Transaction
welcome: Start creating
ru:
intro: Чтобы увидеть статистику
+ introWallets: Чтобы увидеть статистику добавьте первый кошелек
+ introCategories: Чтобы увидеть статистику добавьте первую категорию
createTrn: Создайте свою первую Транзакцию
welcome: Начать создание
</i18n>