forked from LaconicNetwork/cosmos-explorer
Initial project
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
import { $themeConfig } from '@themeConfig'
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
layout: {
|
||||
isRTL: $themeConfig.layout.isRTL,
|
||||
skin: localStorage.getItem('vuexy-skin') || $themeConfig.layout.skin,
|
||||
routerTransition: $themeConfig.layout.routerTransition,
|
||||
type: $themeConfig.layout.type,
|
||||
contentWidth: $themeConfig.layout.contentWidth,
|
||||
menu: {
|
||||
hidden: $themeConfig.layout.menu.hidden,
|
||||
},
|
||||
navbar: {
|
||||
type: $themeConfig.layout.navbar.type,
|
||||
backgroundColor: $themeConfig.layout.navbar.backgroundColor,
|
||||
},
|
||||
footer: {
|
||||
type: $themeConfig.layout.footer.type,
|
||||
},
|
||||
},
|
||||
},
|
||||
getters: {},
|
||||
mutations: {
|
||||
TOGGLE_RTL(state) {
|
||||
state.layout.isRTL = !state.layout.isRTL
|
||||
document.documentElement.setAttribute('dir', state.layout.isRTL ? 'rtl' : 'ltr')
|
||||
},
|
||||
UPDATE_SKIN(state, skin) {
|
||||
state.layout.skin = skin
|
||||
|
||||
// Update value in localStorage
|
||||
localStorage.setItem('vuexy-skin', skin)
|
||||
|
||||
// Update DOM for dark-layout
|
||||
if (skin === 'dark') document.body.classList.add('dark-layout')
|
||||
else if (document.body.className.match('dark-layout')) document.body.classList.remove('dark-layout')
|
||||
},
|
||||
UPDATE_ROUTER_TRANSITION(state, val) {
|
||||
state.layout.routerTransition = val
|
||||
},
|
||||
UPDATE_LAYOUT_TYPE(state, val) {
|
||||
state.layout.type = val
|
||||
},
|
||||
UPDATE_CONTENT_WIDTH(state, val) {
|
||||
state.layout.contentWidth = val
|
||||
},
|
||||
UPDATE_NAV_MENU_HIDDEN(state, val) {
|
||||
state.layout.menu.hidden = val
|
||||
},
|
||||
UPDATE_NAVBAR_CONFIG(state, obj) {
|
||||
Object.assign(state.layout.navbar, obj)
|
||||
},
|
||||
UPDATE_FOOTER_CONFIG(state, obj) {
|
||||
Object.assign(state.layout.footer, obj)
|
||||
},
|
||||
},
|
||||
actions: {},
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { $themeBreakpoints } from '@themeConfig'
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
windowWidth: 0,
|
||||
shallShowOverlay: false,
|
||||
},
|
||||
getters: {
|
||||
currentBreakPoint: state => {
|
||||
const { windowWidth } = state
|
||||
if (windowWidth >= $themeBreakpoints.xl) return 'xl'
|
||||
if (windowWidth >= $themeBreakpoints.lg) return 'lg'
|
||||
if (windowWidth >= $themeBreakpoints.md) return 'md'
|
||||
if (windowWidth >= $themeBreakpoints.sm) return 'sm'
|
||||
return 'xs'
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
UPDATE_WINDOW_WIDTH(state, val) {
|
||||
state.windowWidth = val
|
||||
},
|
||||
TOGGLE_OVERLAY(state, val) {
|
||||
state.shallShowOverlay = val !== undefined ? val : !state.shallShowOverlay
|
||||
},
|
||||
},
|
||||
actions: {},
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"chain_name": "akash",
|
||||
"chain_id": "akashnet-1",
|
||||
"api": "http://lcd.akash.forbole.com",
|
||||
"logo": "https://look.ping.pub/static/chains/cosmoshub.svg"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"chain_name": "cosmos",
|
||||
"api":"https://api.cosmos.network",
|
||||
"logo": "https://look.ping.pub/static/chains/cosmoshub.svg"
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
const chains = {}
|
||||
const configs = require.context('.', false, /\.json$/)
|
||||
|
||||
let selectedChain = {}
|
||||
configs.keys().forEach(k => {
|
||||
const c = configs(k)
|
||||
if (c.chain_name === 'cosmos') {
|
||||
selectedChain = c
|
||||
}
|
||||
chains[c.chain_name] = c
|
||||
})
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
selectedChain,
|
||||
chains,
|
||||
},
|
||||
getters: {
|
||||
getchains: state => state.chains,
|
||||
currentChain: state => chain => state.chains[chain],
|
||||
},
|
||||
mutations: {
|
||||
|
||||
},
|
||||
actions: {},
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
|
||||
// Modules
|
||||
import app from './app'
|
||||
import appConfig from './app-config'
|
||||
import verticalMenu from './vertical-menu'
|
||||
|
||||
import chains from './chains'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
export default new Vuex.Store({
|
||||
modules: {
|
||||
app,
|
||||
appConfig,
|
||||
verticalMenu,
|
||||
chains,
|
||||
},
|
||||
strict: process.env.DEV,
|
||||
})
|
||||
@@ -0,0 +1,15 @@
|
||||
import { $themeConfig } from '@themeConfig'
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
isVerticalMenuCollapsed: $themeConfig.layout.menu.isCollapsed,
|
||||
},
|
||||
getters: {},
|
||||
mutations: {
|
||||
UPDATE_VERTICAL_MENU_COLLAPSED(state, val) {
|
||||
state.isVerticalMenuCollapsed = val
|
||||
},
|
||||
},
|
||||
actions: {},
|
||||
}
|
||||
Reference in New Issue
Block a user