Added disk as option and moved toggle

This commit is contained in:
Liv
2024-01-12 21:27:20 +01:00
parent d822d057a3
commit 8db4424df5
4 changed files with 20 additions and 9 deletions
+16 -9
View File
@@ -114,6 +114,15 @@ 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
onToggle={onExcludeToggle}
text={symptomPage[symptom].excludeText}
value={data.exclude}
/>
</Segment>
)
return ( return (
<AppModal onClose={onSave}> <AppModal onClose={onSave}>
@@ -141,6 +150,10 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
</Segment> </Segment>
) )
})} })}
{/*for bleeding, we want to move the "exclude" toggle up between the tab and box groups, all other symptoms should still have it at the bottom*/}
{symptom === 'bleeding' && excludeToggle}
{shouldShow(symptomConfig.selectBoxGroups) && {shouldShow(symptomConfig.selectBoxGroups) &&
symptomPage[symptom].selectBoxGroups.map((group) => { symptomPage[symptom].selectBoxGroups.map((group) => {
const isOtherSelected = const isOtherSelected =
@@ -167,15 +180,9 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
</Segment> </Segment>
) )
})} })}
{shouldShow(symptomConfig.excludeText) && (
<Segment style={styles.segmentBorder}> {symptom !== 'bleeding' && excludeToggle}
<AppSwitch
onToggle={onExcludeToggle}
text={symptomPage[symptom].excludeText}
value={data.exclude}
/>
</Segment>
)}
{shouldShow(symptomConfig.note) && ( {shouldShow(symptomConfig.note) && (
<Segment style={styles.segmentBorder}> <Segment style={styles.segmentBorder}>
<AppText>{symptomPage[symptom].note}</AppText> <AppText>{symptomPage[symptom].note}</AppText>
+1
View File
@@ -62,6 +62,7 @@ export const blank = {
underwear: null, underwear: null,
cup: null, cup: null,
softTampon: null, softTampon: null,
disk: null,
none: null, none: null,
other: null, other: null,
note: null, note: null,
+2
View File
@@ -24,6 +24,7 @@ const BleedingSchema = {
underwear: { type: 'bool', optional: true }, underwear: { type: 'bool', optional: true },
cup: { type: 'bool', optional: true }, cup: { type: 'bool', optional: true },
softTampon: { type: 'bool', optional: true }, softTampon: { type: 'bool', optional: true },
disk: { type: 'bool', optional: true },
none: { type: 'bool', optional: true }, none: { type: 'bool', optional: true },
other: { type: 'bool', optional: true }, other: { type: 'bool', optional: true },
note: { type: 'string', optional: true }, note: { type: 'string', optional: true },
@@ -184,6 +185,7 @@ export default {
newObjects[i].underwear = false newObjects[i].underwear = false
newObjects[i].cup = false newObjects[i].cup = false
newObjects[i].softTampon = false newObjects[i].softTampon = false
newObjects[i].disk = false
newObjects[i].none = false newObjects[i].none = false
newObjects[i].other = false newObjects[i].other = false
newObjects[i].note = null newObjects[i].note = null
+1
View File
@@ -20,6 +20,7 @@ export const products = {
underwear: 'underwear', underwear: 'underwear',
cup: 'cup', cup: 'cup',
softTampon: 'soft tampon', softTampon: 'soft tampon',
disk: 'disk',
none: 'none', none: 'none',
other: 'other', other: 'other',
}, },