Skip to content

Open source personal finance application

refactor: improve UI styling and remove transaction modal in stat components

Ilya Komichev7ee5eef29a23
diff --git a/app/components/date/LinkItem.vue b/app/components/date/LinkItem.vue
index 4de20f1a..0c7cba55 100644
--- a/app/components/date/LinkItem.vue
+++ b/app/components/date/LinkItem.vue
@@ -17,7 +17,7 @@ const emit = defineEmits<{
:class="[
getStyles('item', ['link', props.variant === 'small' ? '' : 'alt', 'center2', 'minh3', 'rounded4']),
{ 'text-accent-1': props.isActive },
- { 'px-2 text-2xs': props.variant === 'small' },
+ { 'px-2 text-2xs text-2': props.variant === 'small' },
{ 'px-3': props.variant !== 'small' },
]"
class="text-nowrap rounded-full font-primary text-xs leading-none"
diff --git a/app/components/stat/Item.vue b/app/components/stat/Item.vue
index 172f9d65..686206af 100644
--- a/app/components/stat/Item.vue
+++ b/app/components/stat/Item.vue
@@ -41,7 +41,6 @@ const trnsStore = useTrnsStore()
const { getTotalOfTrnsIds } = useAmount()
const { addMarkArea, createSeriesItem } = useStatChart()
-const isShowTrns = ref(false)
const newBaseStorageKey = computed(() => `finapp-${statDate.params.value.intervalsBy}-${props.storageKey}-${JSON.stringify(filter?.categoriesIds?.value)}`)
const selectedType = useStorage<StatTabSlug>(`selectedType-${props.type}-${newBaseStorageKey.value}`, 'summary')
@@ -179,11 +178,6 @@ function onClickCategory(categoryId: CategoryId) {
}
function onClickSumItem(type: StatTabSlug) {
- if (type === 'summary') {
- isShowTrns.value = !isShowTrns.value
- return
- }
-
selectedType.value = type === selectedType.value ? 'summary' : type
}
@@ -281,7 +275,7 @@ function getIntervalsData(trnsIds: TrnId[], intervalsInRange: Range[]) {
<div
class="@3xl/page:pt-3 grid w-full items-start gap-2 pt-1"
:class="{
- '@3xl/page:grid-cols-[1.2fr,1fr] @3xl/page:gap-8': props.activeTab !== 'summary',
+ '@3xl/page:grid-cols-[1.2fr,1fr] @3xl/page:gap-4': props.activeTab !== 'summary',
}"
>
<StatCategoriesSection
@@ -301,32 +295,5 @@ function getIntervalsData(trnsIds: TrnId[], intervalsInRange: Range[]) {
:isPeriodOneDay="isPeriodOneDay"
/>
</div>
-
- <!-- Trns -->
- <Teleport to="body">
- <BottomSheet
- v-if="selectedTrnsIds && selectedTrnsIds?.length > 0 && isShowTrns"
- isShow
- drugClassesCustom="bottomSheetDrugClassesCustom"
- @closed="isShowTrns = false"
- >
- <div class="bottomSheetContent">
- <UiTitleModal>{{ t('trns.title') }} {{ selectedTrnsIds.length }}</UiTitleModal>
-
- <div class="scrollerBlock bottomSheetContentInside">
- <TrnsList
- :trnsIds="selectedTrnsIds"
- class="py-2"
- isShowDates
- isShowExpense
- isShowFilterByDesc
- isShowFilterByType
- isShowGroupSum
- isShowIncome
- />
- </div>
- </div>
- </BottomSheet>
- </Teleport>
</div>
</template>
diff --git a/app/components/stat/ItemWrap.vue b/app/components/stat/ItemWrap.vue
index fb5a53cc..da392ada 100644
--- a/app/components/stat/ItemWrap.vue
+++ b/app/components/stat/ItemWrap.vue
@@ -47,7 +47,7 @@ const incomeTrnsIds = computed(() => trnsStore.getStoreTrnsIds({
<!-- Summary -->
<div
v-if="props.activeTab === 'summary'"
- class="grid max-w-7xl gap-8 px-2 pb-24 md:grid-cols-2 lg:gap-8 lg:px-4 xl:py-2 2xl:px-8"
+ class="grid max-w-7xl gap-8 px-2 pb-24 md:grid-cols-2 lg:gap-2 lg:px-4 xl:py-2 2xl:px-8"
>
<StatItem
:activeTab="props.activeTab"
diff --git a/app/components/stat/categories/Section.vue b/app/components/stat/categories/Section.vue
index 7fc7027f..7eb2955a 100644
--- a/app/components/stat/categories/Section.vue
+++ b/app/components/stat/categories/Section.vue
@@ -183,7 +183,7 @@ function updateState(
v-if="statConfig.config.value.vertical.isShow"
:storageKey="`${storageKey}-${type}-vertical`"
:initStatus="true"
- class="@3xl/page:p-3 mb-4 rounded-xl bg-item-2 p-2 md:max-w-lg"
+ class="@3xl/page:p-3 mb-4 rounded-xl border border-item-4 bg-item-2 p-2 md:max-w-lg"
>
<template #header="{ toggle, isShown }">
<div class="flex items-center justify-between md:max-w-lg">
@@ -272,7 +272,7 @@ function updateState(
v-if="statConfig.config.value.catsRound.isShow"
:storageKey="`${storageKey}-${type}-rounds`"
:initStatus="true"
- class="@3xl/page:p-3 mb-4 rounded-xl bg-item-2 p-2 md:max-w-lg"
+ class="@3xl/page:p-3 mb-4 rounded-xl border border-item-4 bg-item-2 p-2 md:max-w-lg"
>
<template #header="{ toggle, isShown }">
<div class="flex items-center justify-between md:max-w-lg">
@@ -354,7 +354,7 @@ function updateState(
v-if="statConfig.config.value.catsList.isShow"
:storageKey="`${storageKey}-${type}-list`"
:initStatus="true"
- class="@3xl/page:p-3 mb-4 rounded-xl bg-item-2 p-2 md:max-w-lg"
+ class="@3xl/page:p-3 mb-4 rounded-xl border border-item-4 bg-item-2 p-2 md:max-w-lg"
>
<template #header="{ toggle, isShown }">
<div class="flex items-center justify-between md:max-w-lg">
@@ -482,7 +482,7 @@ function updateState(
</template>
<!-- Inside -->
- <div class="ml-5 mt-[-2px] -translate-x-px border-l border-item-4 pl-3">
+ <div class="ml-5 mt-[-2px] -translate-x-px pl-3">
<div
v-if="!item.categories || item.categories.length === 0"
class="mb-3 ml-11"
@@ -553,7 +553,7 @@ function updateState(
</template>
<!-- Inside -->
- <div class="ml-5 mt-[-2px] -translate-x-px border-l border-item-4 pl-14">
+ <div class="ml-5 mt-[-2px] -translate-x-px pl-14">
<TrnsList
:trnsIds="itemInside.trnsIds"
:size="5"
diff --git a/app/components/stat/chart/Wrap.vue b/app/components/stat/chart/Wrap.vue
index e2fab5bd..828d18cf 100644
--- a/app/components/stat/chart/Wrap.vue
+++ b/app/components/stat/chart/Wrap.vue
@@ -50,7 +50,7 @@ function onChangePeriod(period: Period) {
:class="{
'md:max-w-lg': props.chartView === 'half',
}"
- class="mb-3 rounded-xl bg-item-2 p-2"
+ class="mb-3 rounded-xl border border-item-4 bg-item-2 p-2"
>
<div
v-if="statConfig.config.value?.chartShow"
diff --git a/app/components/stat/sum/Item.vue b/app/components/stat/sum/Item.vue
index 3f37f0cc..16bee157 100644
--- a/app/components/stat/sum/Item.vue
+++ b/app/components/stat/sum/Item.vue
@@ -24,7 +24,7 @@ const currenciesStore = useCurrenciesStore()
<template>
<div
- class="@2xl/page:px-4 @2xl/page:pt-3 @2xl/page:pb-2 grid gap-1 border border-transparent bg-item-2 px-3 pt-2"
+ class="@2xl/page:px-4 @2xl/page:pt-3 @2xl/page:pb-2 grid gap-1 rounded-lg border border-item-4 bg-item-2 px-3 pt-2"
:class="{
'!border-accent-1/40 !bg-item-2': props.isActive,
}"
diff --git a/app/components/stat/trns/Section.vue b/app/components/stat/trns/Section.vue
index 6ebd6407..9914f01e 100644
--- a/app/components/stat/trns/Section.vue
+++ b/app/components/stat/trns/Section.vue
@@ -15,7 +15,7 @@ defineProps<{
v-if="selectedTrnsIds.length > 0"
:storageKey="`${storageKey}-${type}trns-all`"
:initStatus="true"
- class="@3xl/page:p-3 mb-4 rounded-xl bg-item-2 p-2 md:max-w-lg"
+ class="@3xl/page:p-3 mb-4 rounded-xl border border-item-4 bg-item-2 p-2 md:max-w-lg"
>
<template #header="{ toggle, isShown }">
<div class="flex items-center justify-between">