From ab33ac2f8bb211dc8411970898dc81e5714fe9f8 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Thu, 8 Mar 2018 19:53:14 +0900 Subject: [PATCH] Create global header design --- src/renderer/components/GlobalHeader.vue | 64 ++++++++++++++++++++++++ src/renderer/components/Login.vue | 5 +- src/renderer/router/index.js | 36 ++++++------- src/renderer/store/GlobalHeader.js | 10 ++++ src/renderer/store/index.js | 2 + 5 files changed, 97 insertions(+), 20 deletions(-) create mode 100644 src/renderer/components/GlobalHeader.vue create mode 100644 src/renderer/store/GlobalHeader.js diff --git a/src/renderer/components/GlobalHeader.vue b/src/renderer/components/GlobalHeader.vue new file mode 100644 index 00000000..c0f489ab --- /dev/null +++ b/src/renderer/components/GlobalHeader.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/src/renderer/components/Login.vue b/src/renderer/components/Login.vue index 5deefb91..2615fb5b 100644 --- a/src/renderer/components/Login.vue +++ b/src/renderer/components/Login.vue @@ -16,9 +16,8 @@ export default { }) }) .then(() => { - // TODO: redirect to home timeline - console.log('ok') - this.$router.push({ path: '/timelinespace' }) + // redirect to home timeline + this.$router.push({ path: '/' }) }) }, methods: { diff --git a/src/renderer/router/index.js b/src/renderer/router/index.js index b39531d9..d0b352fa 100644 --- a/src/renderer/router/index.js +++ b/src/renderer/router/index.js @@ -7,23 +7,25 @@ export default new Router({ routes: [ { path: '/', - name: 'landing-page', - component: require('@/components/LandingPage').default - }, - { - path: '/login', - name: 'login', - component: require('@/components/Login').default - }, - { - path: '/authorize', - name: 'authorize', - component: require('@/components/Authorize').default - }, - { - path: '/timelinespace', - name: 'timeline-space', - component: require('@/components/TimelineSpace').default + name: 'global-header', + component: require('@/components/GlobalHeader').default, + children: [ + { + path: '', + name: 'timeline-space', + component: require('@/components/TimelineSpace').default + }, + { + path: 'login', + name: 'login', + component: require('@/components/Login').default + }, + { + path: 'authorize', + name: 'authorize', + component: require('@/components/Authorize').default + } + ] }, { path: '*', diff --git a/src/renderer/store/GlobalHeader.js b/src/renderer/store/GlobalHeader.js new file mode 100644 index 00000000..85f4187b --- /dev/null +++ b/src/renderer/store/GlobalHeader.js @@ -0,0 +1,10 @@ +const GlobalHeader = { + namespaced: true, + state: { + instances: [] + }, + mutations: {}, + actions: {} +} + +export default GlobalHeader diff --git a/src/renderer/store/index.js b/src/renderer/store/index.js index 4d691a83..45da4238 100644 --- a/src/renderer/store/index.js +++ b/src/renderer/store/index.js @@ -2,6 +2,7 @@ import Vue from 'vue' import Vuex from 'vuex' import createLogger from 'vuex/dist/logger' +import GlobalHeader from './GlobalHeader' import Login from './Login' import Authorize from './Authorize' import TimelineSpace from './TimelineSpace' @@ -14,6 +15,7 @@ export default new Vuex.Store({ ? [createLogger()] : [], modules: { + GlobalHeader, Login, Authorize, TimelineSpace