Skip to content

Open source personal finance application

Update styles, refactor

ilkomef214be9c9f1b
diff --git a/src/components/app/App.vue b/src/components/app/App.vue
index 7f5b3652..cb9877e2 100644
--- a/src/components/app/App.vue
+++ b/src/components/app/App.vue
@@ -122,9 +122,9 @@ html
font-size 14px
line-height 1
letter-spacing 0
- user-select none
overscroll-behavior-y contain
background var(--c-bg-1)
+ user-select none
</style>
<style lang="stylus" scoped>
diff --git a/src/components/dashboard/DashboardFilter.vue b/src/components/dashboard/DashboardFilter.vue
index 48c144da..f9a221b0 100644
--- a/src/components/dashboard/DashboardFilter.vue
+++ b/src/components/dashboard/DashboardFilter.vue
@@ -95,13 +95,7 @@ export default {
display flex
position relative
max-width 1100px
- padding 12px $mb2
-
- @media $media-laptop
- padding 12px $m9
-
- @media $media-pc
- padding 12px $mb2
+ padding 10px 60px
^[0]._sidebar &
padding 20px
diff --git a/src/components/stat/StatItem.vue b/src/components/stat/StatItem.vue
index 66049ead..22c51be2 100644
--- a/src/components/stat/StatItem.vue
+++ b/src/components/stat/StatItem.vue
@@ -41,7 +41,7 @@ export default {
data () {
return {
- showTrns: false
+ showInside: false
}
},
@@ -51,16 +51,17 @@ export default {
const childCatsIdsWithTrns = []
for (const childCategoryId of childCategoriesIds) {
- const trnsIds = this.$store.getters.getSelectedTrnsIdsByFilter({
+ const trnsIds = this.$store.getters.getTrnsIdsByFilter({
categoryId: childCategoryId,
type: this.type
})
if (trnsIds.length > 0) childCatsIdsWithTrns.push(childCategoryId)
}
- if (childCatsIdsWithTrns.length > 0) return true
+ if (childCatsIdsWithTrns.length > 0) return true
return false
},
+
styles () {
return {
width: `${Math.abs(this.total) / Math.abs(this.biggest) * 100}%`,
@@ -70,8 +71,8 @@ export default {
},
methods: {
- toogleShowTrnsInCategory (categoryId) {
- this.showTrns = !this.showTrns
+ toogleShowInside (categoryId) {
+ this.showInside = !this.showInside
}
}
}
@@ -79,13 +80,12 @@ export default {
<template lang="pug">
.statItem(
- @click="toogleShowTrnsInCategory(categoryId)"
- :class="{ _active: showTrns }")
+ @click="toogleShowInside(categoryId)"
+ :class="{ _active: showInside }")
.statItem__content
.statItem__graph: .statItem__graph__in(:style="styles")
- .statItem__icon(
- @click.stop="() => $store.dispatch('handleSetFilterCategory', categoryId)")
+ .statItem__icon(@click.stop="() => $store.dispatch('handleSetFilterCategory', categoryId)")
Icon(
:background="category.color"
:icon="category.icon"
@@ -97,13 +97,12 @@ export default {
:currency="currency"
:value="total")
- template(v-if="showTrns")
- template(v-if="showChildCategories")
- .statItem__cats(@click.stop="")
+ template(v-if="showInside")
+ .statItem__inside(@click.stop="")
+ template(v-if="showChildCategories")
StatItemChildCats(:categoryId="categoryId", :type="type")
- template(v-else)
- .statItem__trns(@click.stop="")
+ template(v-else)
TrnsList(
ui="stat"
:incomes="type === 1"
@@ -112,10 +111,7 @@ export default {
</template>
<style lang="stylus" scoped>
-@import "~@/stylus/variables/margins"
-@import "~@/stylus/variables/fonts"
@import "~@/stylus/variables/media"
-@import "~@/stylus/variables/scrollbar"
.statItem
cursor pointer
@@ -163,7 +159,7 @@ export default {
grid-column 2 / -1
grid-row 2 / -1
align-self center
- margin-top $m5
+ margin-top 6px
background var(--c-bg-8)
border-radius 2px
@@ -192,7 +188,4 @@ export default {
&__amount
align-self center
-
- &__trns
- padding 0
</style>
diff --git a/src/components/stat/StatPc.vue b/src/components/stat/StatPc.vue
index c32ec479..ca2d37b4 100644
--- a/src/components/stat/StatPc.vue
+++ b/src/components/stat/StatPc.vue
@@ -66,7 +66,7 @@ export default {
.stat
position relative
- padding 0 $mb2
+ padding 0 60px
&__content
display flex
diff --git a/src/components/stat/chart/ChartItem.vue b/src/components/stat/chart/ChartItem.vue
index 04daad72..8ae586a8 100644
--- a/src/components/stat/chart/ChartItem.vue
+++ b/src/components/stat/chart/ChartItem.vue
@@ -125,6 +125,7 @@ export default {
@import "~@/stylus/variables/scrollbar"
.chart-item
+ cursor pointer
padding $m5 $m5
flex-grow 1
max-width 80px
diff --git a/src/components/wallets/store/getters.js b/src/components/wallets/store/getters.js
index 88186e09..39d7280d 100644
--- a/src/components/wallets/store/getters.js
+++ b/src/components/wallets/store/getters.js
@@ -30,6 +30,7 @@ export default {
},
walletsTotal (state, getters, rootState, rootGetters) {
+ if (!rootGetters.hasWallets) return {}
const walletsTotal = {}
const wallets = rootState.wallets.items