From 79eae35b11d0fbacc14d4f20e47367ea2bd4425e Mon Sep 17 00:00:00 2001 From: ManjaroOne666 Date: Sat, 2 Feb 2019 16:41:00 +0000 Subject: [PATCH] initial commit --- store/navigation.js | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 store/navigation.js diff --git a/store/navigation.js b/store/navigation.js new file mode 100644 index 0000000..ac0e25c --- /dev/null +++ b/store/navigation.js @@ -0,0 +1,51 @@ +const SITE_NAV = [ + { 'to': '/', 'text': 'Home', bgImgUrl: '/img/devices--bw.jpg'}, + { 'to': '/galleries', 'text': 'Galleries', bgImgUrl: '/img/photo-box--bw.jpg' }, + { 'to': '/services', 'text': 'Services', bgImgUrl: '/img/camera--bw.jpg' }, + { 'to': '/about', 'text': 'About Me', bgImgUrl: '/img/silhouette--dark.jpg' }, + { 'to': '/contact', 'text': 'Contact Me', bgImgUrl: '/img/mail--bw.jpg' }, + ] + +const SOCIAL_NAV = [ + { 'to': 'https://www.instagram.com', 'text': 'Instagram', icon: 'instagram' }, + { 'to': 'https://www.facebook.com', 'text': 'Facebook', icon: 'facebook' }, + { 'to': 'https://twitter.com', 'text': 'Twitter', icon: 'twitter' }, + { 'to': 'https://uk.linkedin.com', 'text': 'LinkedIn', icon: 'linkedin' }, + ] + +export const state = () => ({ + siteNav: [], + socialNav: [], +}) + +export const actions = { + load ({ commit }) { + return new Promise(resolve => { + setTimeout(() => { + commit('updateSiteNav', SITE_NAV) + commit('updateSocialNav', SOCIAL_NAV) + resolve() + }, 300) + }) + } +} + +export const getters = { + siteNav: state => { + return state.siteNav + }, + + socialNav: state => { + return state.socialNav + }, +} + +export const mutations = { + updateSiteNav (state, navItems) { + state.siteNav = navItems + }, + + updateSocialNav (state, socialItems) { + state.socialNav = socialItems + }, +}