Skip to content

Open source personal finance application

Move layouts to own component

ilkomeddf0c48972ef
diff --git a/src/components/app/App.vue b/src/components/app/App.vue
index cb9877e2..a3c49259 100644
--- a/src/components/app/App.vue
+++ b/src/components/app/App.vue
@@ -1,8 +1,7 @@
<script>
import debounce from 'lodash/debounce'
-import LayoutMobile from '@/components/layout/LayoutMobile'
-import LayoutPc from '@/components/layout/LayoutPc'
+import Layout from '@/components/layout/Layout'
import Loader from '@/components/shared/loader/Loader'
import Login from '@/components/login/Login'
import Welcome from '@/components/welcome/Welcome'
@@ -12,8 +11,7 @@ import '@/stylus/index.styl'
export default {
components: {
Loader,
- LayoutMobile,
- LayoutPc,
+ Layout,
Welcome,
Login
},
@@ -90,16 +88,14 @@ export default {
transition(name="fadeInSlow")
template(v-if="$store.state.app.status.ready")
template(v-if="$store.getters.hasWallets && $store.getters.hasCategories")
- LayoutMobile(v-if="$store.state.ui.mobile")
- LayoutPc(v-else)
+ Layout
Welcome(v-else)
//- notifications
notifications(
group="main"
:position="$store.state.ui.mobile ? 'top right' : 'top left'"
- :width="$store.state.ui.mobile ? '100%' : '320'"
- )
+ :width="$store.state.ui.mobile ? '100%' : '280'")
</template>
<style lang="stylus">
diff --git a/src/components/layout/Layout.vue b/src/components/layout/Layout.vue
new file mode 100644
index 00000000..9f90dff0
--- /dev/null
+++ b/src/components/layout/Layout.vue
@@ -0,0 +1,24 @@
+<script>
+import LayoutMobile from '@/components/layout/LayoutMobile'
+import LayoutPc from '@/components/layout/LayoutPc'
+
+console.log('layout')
+
+export default {
+ components: {
+ LayoutMobile,
+ LayoutPc
+ }
+}
+</script>
+
+<template lang="pug">
+.layout
+ LayoutMobile(v-if="$store.state.ui.mobile")
+ LayoutPc(v-if="$store.state.ui.pc")
+</template>
+
+<style lang="stylus" scoped>
+.layout
+ height 100%
+</style>