From 8db4424df553f2ae524c3c0924431290c5edc783 Mon Sep 17 00:00:00 2001 From: Liv Date: Fri, 12 Jan 2024 21:27:20 +0100 Subject: [PATCH] Added disk as option and moved toggle --- components/cycle-day/symptom-edit-view.js | 25 +++++++++++++++-------- components/helpers/cycle-day.js | 1 + db/schemas/5.js | 2 ++ i18n/en/cycle-day.js | 1 + 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/components/cycle-day/symptom-edit-view.js b/components/cycle-day/symptom-edit-view.js index 62060d6..1f92b6e 100644 --- a/components/cycle-day/symptom-edit-view.js +++ b/components/cycle-day/symptom-edit-view.js @@ -114,6 +114,15 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => { style: styles.input, textAlignVertical: 'top', } + const excludeToggle = shouldShow(symptomConfig.excludeText) && ( + + + + ) return ( @@ -141,6 +150,10 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => { ) })} + + {/*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) && symptomPage[symptom].selectBoxGroups.map((group) => { const isOtherSelected = @@ -167,15 +180,9 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => { ) })} - {shouldShow(symptomConfig.excludeText) && ( - - - - )} + + {symptom !== 'bleeding' && excludeToggle} + {shouldShow(symptomConfig.note) && ( {symptomPage[symptom].note} diff --git a/components/helpers/cycle-day.js b/components/helpers/cycle-day.js index 3aa42c2..ef61f7c 100644 --- a/components/helpers/cycle-day.js +++ b/components/helpers/cycle-day.js @@ -62,6 +62,7 @@ export const blank = { underwear: null, cup: null, softTampon: null, + disk: null, none: null, other: null, note: null, diff --git a/db/schemas/5.js b/db/schemas/5.js index b645a52..e85a571 100644 --- a/db/schemas/5.js +++ b/db/schemas/5.js @@ -24,6 +24,7 @@ const BleedingSchema = { underwear: { type: 'bool', optional: true }, cup: { type: 'bool', optional: true }, softTampon: { type: 'bool', optional: true }, + disk: { type: 'bool', optional: true }, none: { type: 'bool', optional: true }, other: { type: 'bool', optional: true }, note: { type: 'string', optional: true }, @@ -184,6 +185,7 @@ export default { newObjects[i].underwear = false newObjects[i].cup = false newObjects[i].softTampon = false + newObjects[i].disk = false newObjects[i].none = false newObjects[i].other = false newObjects[i].note = null diff --git a/i18n/en/cycle-day.js b/i18n/en/cycle-day.js index 490149c..459ee5e 100644 --- a/i18n/en/cycle-day.js +++ b/i18n/en/cycle-day.js @@ -20,6 +20,7 @@ export const products = { underwear: 'underwear', cup: 'cup', softTampon: 'soft tampon', + disk: 'disk', none: 'none', other: 'other', },