Browse Source

:recycle: Placed promptToComponent in lang.js for easy add of survey items

tabs-content
tomit4 3 years ago
parent
commit
326c76a58b
2 changed files with 22 additions and 20 deletions
  1. 21
    0
      frontend/src/utils/lang.js
  2. 1
    20
      frontend/src/utils/survey.js

+ 21
- 0
frontend/src/utils/lang.js View File

@@ -25,6 +25,26 @@ const allSteps = {
25 25
     },
26 26
 }
27 27
 
28
+const promptToComponent = {
29
+    splash: 'Splash',
30
+    name: 'FormInput',
31
+    email: 'FormInput',
32
+    password: 'FormInput',
33
+    zipcode: 'FormInput',
34
+    seeking: 'FormDropdown',
35
+    urgency: 'FormDropdown',
36
+    presence: 'FormDropdown',
37
+    duration: 'FormDropdown',
38
+    pronouns: 'FormDropdown',
39
+    language: 'FormDropdown',
40
+    image: 'FormInput',
41
+    distance: 'FormInput',
42
+    blurb: 'FormInput',
43
+    aspects: 'Aspects',
44
+    // experience: 'FormTags',
45
+    // role: 'FormDropdown',
46
+}
47
+
28 48
 const aspectResponses = {
29 49
     usa: {
30 50
         never: 'never',
@@ -126,6 +146,7 @@ const invalidInputPrompts = {
126 146
 
127 147
 export {
128 148
     promptOverrides,
149
+    promptToComponent,
129 150
     inputPlaceholders,
130 151
     invalidInputPrompts,
131 152
     allSteps,

+ 1
- 20
frontend/src/utils/survey.js View File

@@ -1,26 +1,7 @@
1 1
 import { Survey } from '../entities/index.js'
2 2
 import { fetchQuestions } from '../services/index.js'
3
-import { promptOverrides, inputPlaceholders, invalidInputPrompts ,possible, aspectsArr } from './lang.js'
3
+import { promptOverrides, promptToComponent, inputPlaceholders, invalidInputPrompts ,possible, aspectsArr } from './lang.js'
4 4
 
5
-const promptToComponent = {
6
-    splash: 'Splash',
7
-    name: 'FormInput',
8
-    email: 'FormInput',
9
-    password: 'FormInput',
10
-    zipcode: 'FormInput',
11
-    seeking: 'FormDropdown',
12
-    urgency: 'FormDropdown',
13
-    presence: 'FormDropdown',
14
-    duration: 'FormDropdown',
15
-    pronouns: 'FormDropdown',
16
-    language: 'FormDropdown',
17
-    image: 'FormInput',
18
-    distance: 'FormInput',
19
-    blurb: 'FormInput',
20
-    aspects: 'Aspects',
21
-    // experience: 'FormTags',
22
-    // role: 'FormDropdown',
23
-}
24 5
 /**
25 6
  * Make a step from match or step information
26 7
  * @param {object} match

Loading…
Cancel
Save