-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
Config
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Save
+
+
+
+
diff --git a/src/main.js b/src/main.js
index 5855b61..05a4306 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,6 +1,7 @@
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
+import store from './store'
import App from './App'
import router from './router'
import BootstrapVue from 'bootstrap-vue'
@@ -13,6 +14,7 @@ Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
+ store,
router,
template: '
',
components: { App }
diff --git a/src/store/index.js b/src/store/index.js
new file mode 100644
index 0000000..4764e12
--- /dev/null
+++ b/src/store/index.js
@@ -0,0 +1,11 @@
+import Vue from 'vue'
+import Vuex from 'vuex'
+import user from './modules/user'
+
+Vue.use(Vuex)
+
+export default new Vuex.Store({
+ modules: {
+ user
+ }
+})
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
new file mode 100644
index 0000000..03be69c
--- /dev/null
+++ b/src/store/modules/user.js
@@ -0,0 +1,33 @@
+// initial state
+const state = {
+ name: null,
+ fee_percent: null,
+ minimum_contribution: null,
+ tezos_rpc_address: null,
+ baker_tz_address: null
+}
+
+// actions
+const actions = {
+ loadFromConfigFile ({ commit }) {
+ commit('setUserConfig', require('../../../static/config.json'))
+ }
+}
+
+// mutations
+const mutations = {
+ setUserConfig (state, { name, feePercent, minimumContribution, tezosRpcAddress, bakerTzAddress }) {
+ state.name = name
+ state.fee_percent = feePercent
+ state.minimum_contribution = minimumContribution
+ state.tezos_rpc_address = tezosRpcAddress
+ state.baker_tz_address = bakerTzAddress
+ }
+}
+
+export default {
+ namespaced: true,
+ state,
+ actions,
+ mutations
+}