From 9c2509af3cbe62f58243b8747391190faedf4b94 Mon Sep 17 00:00:00 2001
From: tina <lt-bloody@riox.eu>
Date: Fri, 21 Sep 2018 14:49:14 +0200
Subject: [PATCH] allows unselect in bleeding, mucus, cervix and desire

---
 components/cycle-day/symptoms/bleeding.js | 2 +-
 components/cycle-day/symptoms/cervix.js   | 6 +++---
 components/cycle-day/symptoms/desire.js   | 2 +-
 components/cycle-day/symptoms/mucus.js    | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/components/cycle-day/symptoms/bleeding.js b/components/cycle-day/symptoms/bleeding.js
index 3c88ec5c..c608aebb 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 => this.setState({ currentValue: val })}
+              onSelect={val => val === this.state.currentValue ? this.setState({ currentValue: null }) : this.setState({ currentValue: val })}
             />
           </SymptomSection>
           <SymptomSection
diff --git a/components/cycle-day/symptoms/cervix.js b/components/cycle-day/symptoms/cervix.js
index ccb1cbd1..6a9b78f9 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 => this.setState({ opening: val })}
+              onSelect={val => val === this.state.opening ? this.setState({ opening: null }) : 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 => this.setState({ firmness: val })}
+              onSelect={val => val === this.state.firmness ? this.setState({ firmness: null }) : 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 => this.setState({ position: val })}
+              onSelect={val => val === this.state.position ? this.setState({ position: null }) : this.setState({ position: val })}
             />
           </SymptomSection>
           <SymptomSection
diff --git a/components/cycle-day/symptoms/desire.js b/components/cycle-day/symptoms/desire.js
index ea8800f0..eafdf725 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 => this.setState({ currentValue: val })}
+              onSelect={val => val === this.state.currentValue ? this.setState({ currentValue: null }) : this.setState({ currentValue: val })}
             />
           </SymptomSection>
         </ScrollView>
diff --git a/components/cycle-day/symptoms/mucus.js b/components/cycle-day/symptoms/mucus.js
index a517fcd1..1e137777 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 => this.setState({ feeling: val })}
+              onSelect={val => val === this.state.feeling ? this.setState({ feeling: null }) : this.setState({ feeling: val })}
               active={this.state.feeling}
             />
           </SymptomSection>
@@ -56,7 +56,7 @@ export default class Mucus extends Component {
           >
             <SelectTabGroup
               buttons={mucusTexture}
-              onSelect={val => this.setState({ texture: val })}
+              onSelect={val => val === this.state.texture ? this.setState({ texture: null }) : this.setState({ texture: val })}
               active={this.state.texture}
             />
           </SymptomSection>
-- 
GitLab