Skip to content

Open source personal finance application

chore: refactor stat categories lines

Ilya Komichevbf200d70d19d
diff --git a/app/components/stat/ConfigModal.vue b/app/components/stat/ConfigModal.vue
index d7e1dbe0..6c2fdcb5 100644
--- a/app/components/stat/ConfigModal.vue
+++ b/app/components/stat/ConfigModal.vue
@@ -141,30 +141,25 @@ function updateStatAverage(value: number) {
class="flex gap-4 pt-2"
>
<div class="flex gap-1">
- <UiItem2
- :class="[{
- '!hover:transparent opacity-30': statConfig.config.value.wallets.count === 1,
- }]"
- @click="updateWalletsLimit(statConfig.config.value.wallets.count - 1)"
- >
- <Icon name="lucide:minus" />
- </UiItem2>
- <FormInput
- :placeholder="t('stat.config.showedWallets.placeholder')"
- :value="statConfig.config.value.wallets.count"
- :max="walletsStore.sortedIds.length"
- min="1"
- class="max-w-20 !px-2 text-center"
- type="number"
- @updateValue="value => statConfig.updateConfig('wallets', { count: +value })"
- />
-
- <UiItem2
- :class="{ '!hover:transparent opacity-30': statConfig.config.value.wallets.count >= walletsStore.sortedIds.length }"
- @click="updateWalletsLimit(statConfig.config.value.wallets.count + 1)"
- >
- <Icon name="lucide:plus" />
- </UiItem2>
+ <div class="flex border border-(--ui-border) rounded-(--ui-radius) bg-(--ui-bg) p-px gap-1">
+ <DateLinkItem
+ :class="[{
+ '!hover:transparent opacity-30': statConfig.config.value.wallets.count === 1,
+ }]"
+ @click="updateWalletsLimit(statConfig.config.value.wallets.count - 1)"
+ >
+ -
+ </DateLinkItem>
+ <DateLinkItemNoBg>
+ {{ statConfig.config.value.wallets.count }}
+ </DateLinkItemNoBg>
+ <DateLinkItem
+ :class="{ '!hover:transparent opacity-30': statConfig.config.value.wallets.count >= walletsStore.sortedIds.length }"
+ @click="updateWalletsLimit(statConfig.config.value.wallets.count + 1)"
+ >
+ +
+ </DateLinkItem>
+ </div>
</div>
</div>
</div>
diff --git a/app/components/stat/Item.vue b/app/components/stat/Item.vue
index 4e67f4f6..b2ba799f 100644
--- a/app/components/stat/Item.vue
+++ b/app/components/stat/Item.vue
@@ -148,7 +148,7 @@ const averageTotal = computed(() => {
const items = {
month: 0,
- // eslint-disable-next-line perfectionist/sort-objects
+
week: 0,
// eslint-disable-next-line perfectionist/sort-objects
day: 0,
@@ -168,22 +168,18 @@ const averageTotal = computed(() => {
const typesToShow = computed(() => {
if (props.statTab === 'summary') {
- if (filteredType.value === 'netIncome') {
+ if (filteredType.value === 'netIncome')
return ['income', 'expense']
- }
- if (filteredType.value === 'income') {
+ if (filteredType.value === 'income')
return ['income']
- }
- if (filteredType.value === 'expense') {
+ if (filteredType.value === 'expense')
return ['expense']
- }
}
- if (props.statTab === 'expense' || props.statTab === 'income') {
+ if (props.statTab === 'expense' || props.statTab === 'income')
return [props.statTab]
- }
return [props.type]
})
diff --git a/app/components/stat/categories/Round2lines.vue b/app/components/stat/categories/Round2lines.vue
index b4f7f270..4bc9fdbd 100644
--- a/app/components/stat/categories/Round2lines.vue
+++ b/app/components/stat/categories/Round2lines.vue
@@ -64,7 +64,7 @@ onLongPress(
<div
v-if="category"
ref="longPressRef"
- class="relative flex items-center gap-2 overflow-hidden rounded-2xl dark:bg-item-3 p-1 pr-3 hover:bg-[var(--item-5)]"
+ class="relative flex items-center gap-2 overflow-hidden rounded-2xl dark:bg-item-3 p-1 pr-3 border border-transparent hover:bg-[var(--item-5)]"
>
<div
:style="{ backgroundColor: category?.color }"
diff --git a/app/components/stat/categories/Section.vue b/app/components/stat/categories/Section.vue
index a3ce31a2..fcdce0cd 100644
--- a/app/components/stat/categories/Section.vue
+++ b/app/components/stat/categories/Section.vue
@@ -36,6 +36,7 @@ const visibleCategories = computed(() => isExpanded.value ? roundCategories.valu
:class="{
'opacity-60': props.filteredCategoriesIds?.length > 0 && !props.filteredCategoriesIds?.includes(item.id),
'opacity-50': !props.filteredCategoriesIds?.includes(item.id) && item.value === 0,
+ '!border-(--ui-primary)': props.filteredCategoriesIds?.includes(item.id),
}"
class="transition-opacity"
isShowAmount