init crater

This commit is contained in:
Mohit Panjwani
2019-11-11 12:16:00 +05:30
commit bdf2ba51d6
668 changed files with 158503 additions and 0 deletions

View File

@ -0,0 +1,28 @@
import * as types from './mutation-types'
export const openModal = ({ commit, dispatch, state }, payload) => {
commit(types.SET_COMPONENT_NAME, payload.componentName)
commit(types.SHOW_MODAL, true)
if (payload.id) {
commit(types.SET_ID, payload.id)
}
commit(types.SET_TITLE, payload.title)
if (payload.data) {
commit(types.SET_DATA, payload.data)
}
if (payload.size) {
commit(types.SET_SIZE, payload.size)
}
}
export const closeModal = ({ commit, dispatch, state }) => {
commit(types.RESET_DATA)
commit(types.HIDE_MODAL, false)
}
export const resetModalData = ({ commit, dispatch, state }) => {
commit(types.RESET_DATA)
}

View File

@ -0,0 +1,6 @@
export const modalActive = state => state.active
export const modalTitle = state => state.title
export const componentName = state => state.componentName
export const modalDataID = state => state.id
export const modalData = state => state.data
export const modalSize = state => state.size

View File

@ -0,0 +1,25 @@
import mutations from './mutations'
import * as actions from './actions'
import * as getters from './getters'
const initialState = {
active: false,
content: '',
title: '',
componentName: '',
id: '',
size: 'md',
data: null
}
export default {
namespaced: true,
state: initialState,
getters: getters,
actions: actions,
mutations: mutations
}

View File

@ -0,0 +1,8 @@
export const SHOW_MODAL = 'SHOW_MODAL'
export const SET_TITLE = 'SET_TITLE'
export const SET_COMPONENT_NAME = 'SET_COMPONENT_NAME'
export const HIDE_MODAL = 'HIDE_MODAL'
export const SET_ID = 'SET_ID'
export const SET_SIZE = 'SET_SIZE'
export const SET_DATA = 'SET_DATA'
export const RESET_DATA = 'RESET_DATA'

View File

@ -0,0 +1,40 @@
import * as types from './mutation-types'
export default {
[types.SHOW_MODAL] (state, data) {
state.active = data
},
[types.HIDE_MODAL] (state, data) {
state.active = data
},
[types.SET_TITLE] (state, data) {
state.title = data
},
[types.SET_COMPONENT_NAME] (state, data) {
state.componentName = data
},
[types.SET_ID] (state, data) {
state.id = data
},
[types.SET_DATA] (state, data) {
state.data = data
},
[types.SET_SIZE] (state, size) {
state.size = size
},
[types.RESET_DATA] (state) {
state.active = false
state.content = ''
state.title = ''
state.componentName = ''
state.id = ''
state.data = null
}
}