From 9b7b9d2af8895aea645afa21623214768de60cca Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Wed, 3 Mar 2021 22:31:54 -0700 Subject: [PATCH] Move the team settings into the config. --- web/src/config.js | 35 +++++++++++++++++++++++++++++++++++ web/src/store/index.js | 23 +++-------------------- 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/web/src/config.js b/web/src/config.js index 873d088..ca918ab 100644 --- a/web/src/config.js +++ b/web/src/config.js @@ -5,6 +5,41 @@ export const survey_url = ``; +/** + * This is an array of per-team settings, each team object consists of the + * following properties: + * + * name: string - The name of the team + * icon: string - The name of the icon used for the team + * eyes: object - The object of the answer index to how many eyes are on that spot + * + * There can be as many teams in this array as desired, but only the first two + * will be used. + */ +export const team_settings = [ + { + name: `Sun`, + icon: `sun.svg`, + eyes: { + 1: 0, 2: 0, + 3: 0, 4: 1, + 5: 0, 6: 1, + 7: 1, 8: 0, + } + }, + { + name: `Moon`, + icon: `moon.svg`, + eyes: { + 1: 0, 2: 0, + 3: 1, 4: 0, + 5: 1, 6: 1, + 7: 0, 8: 0, + } + } +] + + /** * The URI that socket IO tries to connect to for websocket communication when * built for production serving. diff --git a/web/src/store/index.js b/web/src/store/index.js index 401af00..75df02a 100644 --- a/web/src/store/index.js +++ b/web/src/store/index.js @@ -8,26 +8,9 @@ export default new Vuex.Store({ state: { survey_link: conf.survey_url, - team_1: { - name: `Sun`, - icon: `sun.svg`, - eyes: { - 1: 0, 2: 0, - 3: 0, 4: 1, - 5: 0, 6: 1, - 7: 1, 8: 0, - }, - }, - team_2: { - name: `Moon`, - icon: `moon.svg`, - eyes: { - 1: 0, 2: 0, - 3: 1, 4: 0, - 5: 1, 6: 1, - 7: 0, 8: 0, - }, - }, + team_1: conf.team_settings[0], + team_2: conf.team_settings[1], + writer_name: `Spirit`, writer_card_button: `Answer Question`, writer_object_choose_button: `Choose Object`,