Skip to content

Open source personal finance application

Small refactor

Ilya Komichev6d535e484b39
diff --git a/src/components/settings/Settings.vue b/src/components/settings/Settings.vue
index 738a2f2d..858a33b8 100644
--- a/src/components/settings/Settings.vue
+++ b/src/components/settings/Settings.vue
@@ -106,18 +106,29 @@ export default {
max-width 380px
&__group
- padding-bottom $m10
+ padding-bottom 48px
+ &._paddingTop
+ padding-top 48px
+
+ &__item
+ padding-bottom $m7
+ &:last-child
+ padding-bottom 0
&__desc
- padding-bottom $m5
+ padding-bottom 8px
font-size 14px
color var(--c-red-1)
&__header
font-header-4()
+ font-weight 500
+ font-size 24px
padding-bottom $mn2
&__subHeader
font-header-1()
- padding-bottom $m7
+ font-size 16px
+ font-weight 500
+ padding-bottom 16px
</style>
diff --git a/src/components/shared/button/Button.vue b/src/components/shared/button/Button.vue
index 45b4efdd..7bbddb34 100644
--- a/src/components/shared/button/Button.vue
+++ b/src/components/shared/button/Button.vue
@@ -1,9 +1,11 @@
<script>
import Icon from '@/components/icon/Icon'
+import Checkbox from '@/components/shared/inputs/Checkbox'
export default {
components: {
- Icon
+ Icon,
+ Checkbox
},
props: {
@@ -22,6 +24,14 @@ export default {
title: {
type: String,
default: null
+ },
+ showCheckbox: {
+ type: Boolean,
+ default: false
+ },
+ checkboxValue: {
+ type: Boolean,
+ default: false
}
}
}
@@ -36,6 +46,9 @@ export default {
.d-button__icon(v-if="icon")
div(:class="icon")
.d-button__title {{ title }}
+ .d-button__check(v-if="showCheckbox" @click.prevent="")
+ Checkbox._small(v-model="checkboxValue")
+
</template>
<style lang="stylus">
@@ -81,10 +94,11 @@ export default {
width 100%
display flex
align-items center
- // min-height 40px
padding $m7 $m8
color var(--c-font-2)
cursor pointer
+ border-radius $m3
+ font-size 15px
anim-background()
&:active
@@ -94,7 +108,6 @@ export default {
display inline-flex
align-items center
justify-content center
- // height 52px
font-header-2()
font-size 16px
color var(--c-font-1)
@@ -108,7 +121,8 @@ export default {
background var(--c-blue-2)
&._bdb
- border-bottom 1px solid var(--c-bg-5)
+ padding 12px $m7
+ border 1px solid var(--c-bg-5)
&:hover
@media $media-laptop
background var(--c-bg-5)
@@ -167,4 +181,8 @@ export default {
font-size 20px
text-align center
opacity .85
+
+ &__check
+ margin-left auto
+ padding-left 32px
</style>
diff --git a/src/components/shared/contextMenu/ContextMenuItem.vue b/src/components/shared/contextMenu/ContextMenuItem.vue
index eda7889a..6af680ee 100644
--- a/src/components/shared/contextMenu/ContextMenuItem.vue
+++ b/src/components/shared/contextMenu/ContextMenuItem.vue
@@ -1,5 +1,11 @@
<script>
+import Checkbox from '@/components/shared/inputs/Checkbox'
+
export default {
+ components: {
+ Checkbox
+ },
+
props: {
icon: {
type: String,
@@ -16,6 +22,14 @@ export default {
selected: {
type: Boolean,
default: false
+ },
+ showCheckbox: {
+ type: Boolean,
+ default: false
+ },
+ checkboxValue: {
+ type: Boolean,
+ default: false
}
},
@@ -35,6 +49,8 @@ export default {
.item__icon(v-if="icon"): div(:class="icon")
.item__title {{ title }}
.item__check(v-if="checkValue"): .mdi.mdi-check-circle-outline
+ .item__check(v-if="showCheckbox" @click.prevent="")
+ Checkbox._small(v-model="checkboxValue")
</template>
<style lang="stylus" scoped>
@@ -81,9 +97,6 @@ export default {
color var(--c-font-3)
&__check
- opacity .80
margin-left auto
- padding-left $m7
- color var(--c-incomes-1)
- font-size 20px
+ padding-left 32px
</style>
diff --git a/src/components/shared/dropdown/Dropdown.vue b/src/components/shared/dropdown/Dropdown.vue
index 427c0553..a4c649ad 100644
--- a/src/components/shared/dropdown/Dropdown.vue
+++ b/src/components/shared/dropdown/Dropdown.vue
@@ -38,7 +38,6 @@ export default {
margin-left auto
border-radius $m3
font-size 16px
- text-transform capitalize
&._inline
display inline-flex
diff --git a/src/components/shared/inputs/Checkbox.vue b/src/components/shared/inputs/Checkbox.vue
index a3715a64..a4020873 100644
--- a/src/components/shared/inputs/Checkbox.vue
+++ b/src/components/shared/inputs/Checkbox.vue
@@ -8,7 +8,7 @@ export default {
},
title: {
type: String,
- required: true
+ default: null
}
}
}
@@ -21,22 +21,30 @@ label.checkbox
:checked="value"
v-on:input="$emit('input', $event.target.checked)"
)
- .checkbox__helper: .checkbox__toogle
- .checkbox__title {{ title }}
+ .checkbox__helper
+ .checkbox__toogle
+ .checkbox__toogle__item._on on
+ .checkbox__toogle__item._off off
+ .checkbox__title(v-if="title") {{ title }}
</template>
<style lang="stylus" scoped>
-$width = 3.4em
-$height = 1.6em
-$left = 1.8em
-$color-rail = var(--c-font-2)
-
.checkbox
position relative
display flex
align-items center
font-size 16px
+ --width 3.4em
+ --height 1.6em
+ --left 1.8em
+ $color-rail = var(--c-font-2)
+
+ &._small
+ --width 2.6em
+ --height 1.2em
+ --left 1.5em
+
&__title
padding 0 1em
font-size 1em
@@ -47,35 +55,38 @@ $color-rail = var(--c-font-2)
&:checked
+ .checkbox__helper:before
- background var(--c-incomes-1)
- box-shadow inset 0px 1px 1px rgba(84, 152, 140, 0.5)
+ background var(--c-bg-1)
+ box-shadow inset 0px 1px 1px background var(--c-bg-12)
+ /.theme-light &
+ background var(--c-bg-13)
+ .checkbox__helper:after
animation switch .2s ease-out
- left $left
+ left var(--left)
&__helper
flex-shrink 0
position relative
- width $width
- height $height
+ width var(--width)
+ height var(--height)
cursor pointer
&:before
content ''
position absolute
- width $width
- height $height
+ width var(--width)
+ height var(--height)
left 0
transition background 0.1s ease
background var(--c-bg-8)
border-radius 50px
+ top .5px
// trail
&:after
z-index 1
content ''
position absolute
- width $height
- height $height
+ width var(--height)
+ height var(--height)
border-radius 50px
left 0em
transition all 0.2s ease
@@ -91,23 +102,27 @@ $color-rail = var(--c-font-2)
top 0
display flex
align-items center
- width $width
- height $height
+ width var(--width)
+ height var(--height)
padding 0 .3em
padding-top .1em
+ ^[0]._small &
+ padding-left .02em
+ padding-right .02em
- &:before
- &:after
+ &__item
flex 1 1
color var(--c-font-2)
font-size .7em
text-align center
text-transform uppercase
+ ^[0]._small &
+ font-size .5em
/.theme-light &
color var(--c-font-1)
- &:before
+ &._on
content 'on'
- &:after
+ &._off
content 'off'
@keyframes switch
diff --git a/src/components/wallets/form/WalletForm.vue b/src/components/wallets/form/WalletForm.vue
index 86dc7bdc..f990898b 100644
--- a/src/components/wallets/form/WalletForm.vue
+++ b/src/components/wallets/form/WalletForm.vue
@@ -185,15 +185,13 @@ export default {
.form-line._p0._clean
Checkbox(
v-model="wallet.countTotal"
- title="Count amount of this wallet in total"
- )
+ title="Count amount of this wallet in total")
.form__actions
Button(
className="_blue"
title="Save wallet"
- v-on:onClick="handleSubmit"
- )
+ v-on:onClick="handleSubmit")
//- colors
ModalBottom(
@@ -218,8 +216,7 @@ export default {
:center="true"
:show="showCurrencies"
title="Select currency"
- v-on:onClose="showCurrencies = false"
- )
+ v-on:onClose="showCurrencies = false")
.inputText
.currencies
.currencies__item(