diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index a8673fd6e493975650e42c858d95e2239040bb87..b960d95767918e5d04e078768253c5d9d0264bea 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -23,7 +23,7 @@ export default class SelectTabGroup extends Component { if (isActive) activeStyle = styles.selectTabActive return ( <TouchableOpacity - onPress={() => this.props.onSelect(value)} + onPress={() => isActive ? this.props.onSelect(null) : this.props.onSelect(value)} key={i} activeOpacity={1} > diff --git a/components/cycle-day/symptoms/bleeding.js b/components/cycle-day/symptoms/bleeding.js index c608aebb58fc63ffe1b507262f2dd9806e14bf70..3c88ec5cc665eb1a4ea70e826d1511589b4374a8 100644 --- a/components/cycle-day/symptoms/bleeding.js +++ b/components/cycle-day/symptoms/bleeding.js @@ -39,7 +39,7 @@ export default class Bleeding extends Component { <SelectTabGroup buttons={bleedingRadioProps} active={this.state.currentValue} - onSelect={val => val === this.state.currentValue ? this.setState({ currentValue: null }) : this.setState({ currentValue: val })} + onSelect={val => this.setState({ currentValue: val })} /> </SymptomSection> <SymptomSection diff --git a/components/cycle-day/symptoms/cervix.js b/components/cycle-day/symptoms/cervix.js index 6a9b78f90082df54e13d6758c51adff27bfbda4f..ccb1cbd183ab25c919adf1cdf49e2a417469b6ab 100644 --- a/components/cycle-day/symptoms/cervix.js +++ b/components/cycle-day/symptoms/cervix.js @@ -49,7 +49,7 @@ export default class Cervix extends Component { <SelectTabGroup buttons={cervixOpeningRadioProps} active={this.state.opening} - onSelect={val => val === this.state.opening ? this.setState({ opening: null }) : this.setState({ opening: val })} + onSelect={val => this.setState({ opening: val })} /> </SymptomSection> <SymptomSection @@ -59,7 +59,7 @@ export default class Cervix extends Component { <SelectTabGroup buttons={cervixFirmnessRadioProps} active={this.state.firmness} - onSelect={val => val === this.state.firmness ? this.setState({ firmness: null }) : this.setState({ firmness: val })} + onSelect={val => this.setState({ firmness: val })} /> </SymptomSection> <SymptomSection @@ -69,7 +69,7 @@ export default class Cervix extends Component { <SelectTabGroup buttons={cervixPositionRadioProps} active={this.state.position} - onSelect={val => val === this.state.position ? this.setState({ position: null }) : this.setState({ position: val })} + onSelect={val => this.setState({ position: val })} /> </SymptomSection> <SymptomSection diff --git a/components/cycle-day/symptoms/desire.js b/components/cycle-day/symptoms/desire.js index eafdf72500fff1d87149727bd47365bb5c559705..ea8800f074d1333d45836090963372c84b7c5812 100644 --- a/components/cycle-day/symptoms/desire.js +++ b/components/cycle-day/symptoms/desire.js @@ -35,7 +35,7 @@ export default class Desire extends Component { <SelectTabGroup buttons={desireRadioProps} active={this.state.currentValue} - onSelect={val => val === this.state.currentValue ? this.setState({ currentValue: null }) : this.setState({ currentValue: val })} + onSelect={val => this.setState({ currentValue: val })} /> </SymptomSection> </ScrollView> diff --git a/components/cycle-day/symptoms/mucus.js b/components/cycle-day/symptoms/mucus.js index 1e1377772b2f32a744cf1012def895fbc962a551..a517fcd1b0f27b84105cee06998476b4951c7d7b 100644 --- a/components/cycle-day/symptoms/mucus.js +++ b/components/cycle-day/symptoms/mucus.js @@ -46,7 +46,7 @@ export default class Mucus extends Component { > <SelectTabGroup buttons={mucusFeeling} - onSelect={val => val === this.state.feeling ? this.setState({ feeling: null }) : this.setState({ feeling: val })} + onSelect={val => this.setState({ feeling: val })} active={this.state.feeling} /> </SymptomSection> @@ -56,7 +56,7 @@ export default class Mucus extends Component { > <SelectTabGroup buttons={mucusTexture} - onSelect={val => val === this.state.texture ? this.setState({ texture: null }) : this.setState({ texture: val })} + onSelect={val => this.setState({ texture: val })} active={this.state.texture} /> </SymptomSection>