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 + }, +}