From e289094d97e16494aadd738d18bf00518e73b479 Mon Sep 17 00:00:00 2001 From: Maria Zadnepryanets Date: Fri, 16 Sep 2022 18:29:26 +0000 Subject: [PATCH] Fix: temperature screen --- components/cycle-day/symptom-edit-view.js | 193 +++++++++++----------- 1 file changed, 101 insertions(+), 92 deletions(-) diff --git a/components/cycle-day/symptom-edit-view.js b/components/cycle-day/symptom-edit-view.js index 45b71d9..5af0ae8 100644 --- a/components/cycle-day/symptom-edit-view.js +++ b/components/cycle-day/symptom-edit-view.js @@ -112,98 +112,100 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => { return ( - + - {symptom === 'temperature' && ( - onSaveTemperature(value, field)} - /> - )} - {shouldShow(symptomConfig.selectTabGroups) && - symtomPage[symptom].selectTabGroups.map((group) => { - return ( - - {group.title} - onSelectTab(group, value)} - /> - - ) - })} - {shouldShow(symptomConfig.selectBoxGroups) && - symtomPage[symptom].selectBoxGroups.map((group) => { - const isOtherSelected = - data['other'] !== null && - data['other'] !== false && - Object.keys(group.options).includes('other') - - return ( - - {group.title} - onSelectBox(value)} - optionsState={data} - /> - {isOtherSelected && ( - onSelectBoxNote(value)} + + {symptom === 'temperature' && ( + onSaveTemperature(value, field)} + /> + )} + {shouldShow(symptomConfig.selectTabGroups) && + symtomPage[symptom].selectTabGroups.map((group) => { + return ( + + {group.title} + onSelectTab(group, value)} /> - )} - - ) - })} - {shouldShow(symptomConfig.excludeText) && ( - - - - )} - {shouldShow(symptomConfig.note) && ( - - {symtomPage[symptom].note} - - - )} - - - - - - {shouldShowInfo && ( - - {info[symptom].text} - - )} - + + ) + })} + {shouldShow(symptomConfig.selectBoxGroups) && + symtomPage[symptom].selectBoxGroups.map((group) => { + const isOtherSelected = + data['other'] !== null && + data['other'] !== false && + Object.keys(group.options).includes('other') + + return ( + + {group.title} + onSelectBox(value)} + optionsState={data} + /> + {isOtherSelected && ( + onSelectBoxNote(value)} + /> + )} + + ) + })} + {shouldShow(symptomConfig.excludeText) && ( + + + + )} + {shouldShow(symptomConfig.note) && ( + + {symtomPage[symptom].note} + + + )} + + + + + + {shouldShowInfo && ( + + {info[symptom].text} + + )} + + ) } @@ -218,21 +220,28 @@ SymptomEditView.propTypes = { const styles = StyleSheet.create({ buttonsContainer: { ...Containers.rowContainer, + paddingHorizontal: Spacing.base, + paddingBottom: Spacing.base, }, headerContainer: { flexDirection: 'row', justifyContent: 'flex-end', - paddingVertical: Spacing.tiny, + paddingTop: Spacing.base, + paddingHorizontal: Spacing.base, + position: 'absolute', + width: '100%', + zIndex: 3, // works on ios + elevation: 3, // works on android }, modalContainer: { - flex: 1, - padding: Spacing.base, + paddingHorizontal: Spacing.base, }, modalWindow: { alignSelf: 'center', backgroundColor: 'white', borderRadius: 10, - marginVertical: Sizes.huge * 2, + marginTop: Sizes.huge * 2, + paddingTop: Spacing.large * 2, position: 'absolute', minHeight: '40%', maxHeight: Dimensions.get('window').height * 0.7,