diff --git a/src/Util.jsx b/src/Util.jsx index d3f5c31..e4b800d 100644 --- a/src/Util.jsx +++ b/src/Util.jsx @@ -1,33 +1,45 @@ import i18n from './i18n.jsx'; const colors = [ - '#6f0214', - '#b20616', - '#ff5d00', - '#ffb200', - '#6bca24', - '#019812', '#015411', + '#019812', + '#6bca24', + '#ffb200', + '#ff5d00', + '#b20616', + '#6f0214', ]; const gradeNames = [ - 'To reject', - 'Insufficient', - 'Passable', - 'Fair', - 'Good', - 'Very good', 'Excellent', + 'Very good', + 'Good', + 'Fair', + 'Passable', + 'Insufficient', + 'To reject', +]; + +const gradeValues = [ + 6, + 5, + 4, + 3, + 2, + 1, + 0 ]; export const grades = gradeNames.map((name, i) => ({ label: name, color: colors[i], + value: gradeValues[i] })); export const i18nGrades = () => { return gradeNames.map((name, i) => ({ label: i18n.t(name), color: colors[i], + value: gradeValues[i] })); }; diff --git a/src/components/layouts/Footer.jsx b/src/components/layouts/Footer.jsx index fa95260..82098fb 100644 --- a/src/components/layouts/Footer.jsx +++ b/src/components/layouts/Footer.jsx @@ -33,7 +33,6 @@ class Footer extends Component { style={linkStyle}> {t('Who are we?')} - -
{i + 1} | - {gradeIds.map((id, i) => { + {gradeIds.slice(0).reverse().map((id, i) => { const value = candidate.profile[id]; const percent = ( (value / numVotes) * diff --git a/src/components/views/Vote.jsx b/src/components/views/Vote.jsx index 30e38e5..793ed5c 100644 --- a/src/components/views/Vote.jsx +++ b/src/components/views/Vote.jsx @@ -169,6 +169,7 @@ class Vote extends Component { render() { const {t} = this.props; const {redirectTo, candidates, electionGrades} = this.state; + const offsetGrade = i18nGrades().length-this.state.numGrades; if (redirectTo) { return