diff --git a/source/components/PeriodSwitch.css b/source/components/PeriodSwitch.css index 2bf26ac14..9db38c1f5 100644 --- a/source/components/PeriodSwitch.css +++ b/source/components/PeriodSwitch.css @@ -11,7 +11,8 @@ } #PeriodSwitch input[type='radio'] { - display: none; + position: fixed; + left: -100%; } input[type='radio'] + span { @@ -24,11 +25,17 @@ input[type='radio'] + span { cursor: pointer; box-shadow: 0 0 0px 1px rgb(41, 117, 209); } +input[type='radio'] ~ span { + cursor: pointer; +} input[type='radio']:checked + span { background: var(--colour); border: 4px solid white; } +input[type='radio']:focus ~ .radioText { + border: 1px dotted gray; +} input[type='radio']:checked ~ .radioText { font-weight: 500; } diff --git a/source/components/PeriodSwitch.js b/source/components/PeriodSwitch.js index dfc52325b..79fb9019c 100644 --- a/source/components/PeriodSwitch.js +++ b/source/components/PeriodSwitch.js @@ -1,17 +1,16 @@ -import React from 'react' -import { Trans, translate } from 'react-i18next' -import { Field } from 'redux-form' -import './PeriodSwitch.css' -import { reduxForm, change } from 'redux-form' -import { compose, map, filter, toPairs } from 'ramda' -import emoji from 'react-easy-emoji' -import { batchActions } from 'redux-batched-actions' -import { connect } from 'react-redux' -import { - situationSelector, - flatRulesSelector -} from 'Selectors/analyseSelectors' import { findRuleByDottedName, nestedSituationToPathMap } from 'Engine/rules' +import { compose, filter, map, toPairs } from 'ramda' +import React from 'react' +import emoji from 'react-easy-emoji' +import { Trans, translate } from 'react-i18next' +import { connect } from 'react-redux' +import { batchActions } from 'redux-batched-actions' +import { change, Field, reduxForm } from 'redux-form' +import { + flatRulesSelector, + situationSelector +} from 'Selectors/analyseSelectors' +import './PeriodSwitch.css' export default compose( reduxForm({ @@ -38,7 +37,7 @@ export default compose( component="input" type="radio" value="mois" - onChange={e => + onChange={() => updateSituation('mois', batchPeriodChange, situation, rules) } /> @@ -54,7 +53,7 @@ export default compose( component="input" type="radio" value="année" - onChange={e => + onChange={() => updateSituation('année', batchPeriodChange, situation, rules) } /> diff --git a/source/reducers/rootReducer.js b/source/reducers/rootReducer.js index 286df0c60..0f9039848 100644 --- a/source/reducers/rootReducer.js +++ b/source/reducers/rootReducer.js @@ -17,7 +17,6 @@ import { combineReducers } from 'redux' import { reducer as formReducer } from 'redux-form' import computeThemeColours from 'Ui/themeColours' import { simulationTargetNames } from '../config.js' -import i18n from '../i18n' import inFranceAppReducer from './inFranceAppReducer' import storageReducer from './storageReducer' import type { Action } from 'Types/ActionsTypes' @@ -66,15 +65,6 @@ function activeTargetInput(state = null, { type, name }) { } } -function lang(state = i18n.language, { type, lang }) { - switch (type) { - case 'SWITCH_LANG': - return lang - default: - return state - } -} - type ConversationSteps = {| +foldedSteps: Array, +unfoldedStep: ?string, @@ -166,7 +156,6 @@ export default reduceReducers( // this is handled by redux-form, pas touche ! form: formReducer, conversationSteps, - lang, targetNames: defaultTo(simulationTargetNames), themeColours, explainedVariable,