Chore: Merge exclude functionality with latest main

This commit is contained in:
bl00dymarie
2024-04-09 13:12:09 +02:00
parent e6134b4592
commit 01582c4e16
+17 -21
View File
@@ -117,15 +117,23 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
style: styles.input, style: styles.input,
textAlignVertical: 'top', textAlignVertical: 'top',
} }
const excludeToggle = shouldShow(symptomConfig.excludeText) && (
<Segment style={styles.segmentBorder}> {
<AppSwitch /* show exclude AppSwitch for bleeding, mucus, cervix, temperature */
onToggle={onExcludeToggle} }
text={symptomPage[symptom].excludeText} {
value={data.exclude} /* but if fertility is off only for bleeding */
/> }
</Segment> const excludeToggle = shouldShow(symptomConfig.excludeText) &&
) (isBleeding || isFertilityTrackingEnabled) && (
<Segment style={styles.segmentBorder}>
<AppSwitch
onToggle={onExcludeToggle}
text={symptomPage[symptom].excludeText}
value={data.exclude}
/>
</Segment>
)
return ( return (
<AppModal onClose={onSave}> <AppModal onClose={onSave}>
@@ -189,18 +197,6 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
</Segment> </Segment>
) )
})} })}
{/* show exclude AppSwitch for bleeding, mucus, cervix, temperature */}
{/* but if fertility is off only for bleeding */}
{shouldShow(symptomConfig.excludeText) &&
(symptom === 'bleeding' || isFertilityTrackingEnabled) && (
<Segment style={styles.segmentBorder}>
<AppSwitch
onToggle={onExcludeToggle}
text={symptomPage[symptom].excludeText}
value={data.exclude}
/>
</Segment>
)}
{!isBleeding && excludeToggle} {!isBleeding && excludeToggle}