Permalink
Please sign in to comment.
Showing
with
192 additions
and 34 deletions.
- +0 −1 .travis.yml
- +9 −2 components/info/countries.js
- +2 −2 components/info/gender.js
- +3 −1 components/info/index.js
- +78 −0 components/info/tests.js
- +10 −11 components/loading.js
- +2 −1 components/progressbar.js
- +34 −3 components/results/index.js
- +21 −8 components/thetest.js
- +2 −1 config/index.js
- +10 −2 layouts/index.js
- +12 −2 pages/index.js
- +9 −0 static/ga.js
| @@ -0,0 +1,78 @@ | ||
| +import React from 'react' | ||
| + | ||
| +const tests = [ | ||
| + { | ||
| + id: '120', | ||
| + text: "(Recommended) 120 questions (Johnson's IPIP NEO-PI-R)", | ||
| + active: true | ||
| + }, | ||
| + { | ||
| + id: '100', | ||
| + text: "Costa and McCrae's NEO-PI-R (100 questions)", | ||
| + active: true | ||
| + }, | ||
| + { | ||
| + id: '50', | ||
| + text: "Costa and McCrae's NEO-PI-R (50 questions)", | ||
| + active: true | ||
| + }, | ||
| + { | ||
| + id: '20', | ||
| + text: 'Mini-IPIP 5-factors (20 questions)', | ||
| + active: true | ||
| + }, | ||
| + { | ||
| + id: 'hexaco', | ||
| + text: "Lee and Ashton's HEXACO-PI (240 questions) (EXPERIMENTAL)", | ||
| + active: false | ||
| + } | ||
| +] | ||
| + | ||
| +export default ({ switchTest, selectedTest }) => ( | ||
| + <span> | ||
| + <p className='question'> | ||
| + Choose test: | ||
| + </p> | ||
| + { | ||
| + tests.map(t => | ||
| + <span | ||
| + key={t.id} | ||
| + id={t.id} | ||
| + onClick={switchTest} | ||
| + className={ | ||
| + selectedTest === t.id ? 'testSelected' : t.active ? 'tests' : 'tests testInactive' | ||
| + } | ||
| + > | ||
| + {t.text} | ||
| + <br /> | ||
| + </span> | ||
| + ) | ||
| + } | ||
| + <style> | ||
| + {` | ||
| + .tests { | ||
| + padding: 5px; | ||
| + cursor: pointer; | ||
| + margin-left: 4px; | ||
| + line-height: 30px; | ||
| + } | ||
| + .testInactive { | ||
| + color: #b1b1b1; | ||
| + font-style: italic; | ||
| + cursor: not-allowed; | ||
| + } | ||
| + .testSelected { | ||
| + font-weight: bold; | ||
| + padding: 2px; | ||
| + cursor: pointer; | ||
| + margin-left: 4px; | ||
| + line-height: 30px; | ||
| + border-radius: 10px; | ||
| + padding: 5px; | ||
| + background-color: #e6e6e6; | ||
| + } | ||
| + | ||
| + `} | ||
| + </style> | ||
| + </span> | ||
| +) |
Oops, something went wrong.
0 comments on commit
89004e1