diff --git a/components/common/segment.js b/components/common/segment.js index 0069666..0f85b7a 100644 --- a/components/common/segment.js +++ b/components/common/segment.js @@ -6,13 +6,14 @@ import AppText from './app-text' import { Colors, Containers, Spacing, Typography } from '../../styles' -const Segment = ({ children, last, title }) => { +const Segment = ({ children, last, title, subheader }) => { const containerStyle = last ? styles.containerLast : styles.container const commonStyle = Object.assign({}, containerStyle) return ( {title && {title}} + {subheader && {subheader}} {children} ) @@ -23,6 +24,7 @@ Segment.propTypes = { last: PropTypes.bool, style: PropTypes.object, title: PropTypes.string, + subheader: PropTypes.string, } const styles = StyleSheet.create({ @@ -39,6 +41,11 @@ const styles = StyleSheet.create({ title: { ...Typography.subtitle, }, + subheader: { + ...Typography.subtitle, + fontWeight: 'bold', + marginBottom: Spacing.zero, + }, }) export default Segment diff --git a/components/cycle-day/symptom-edit-view.js b/components/cycle-day/symptom-edit-view.js index 616f70b..b87ae58 100644 --- a/components/cycle-day/symptom-edit-view.js +++ b/components/cycle-day/symptom-edit-view.js @@ -15,6 +15,7 @@ import Temperature from './temperature' import { blank, save, shouldShow, symtomPage } from '../helpers/cycle-day' import { showToast } from '../helpers/general' +import { fertilityTrackingObservable } from '../../local-storage' import { shared as sharedLabels } from '../../i18n/en/labels' import info from '../../i18n/en/symptom-info' import { Colors, Containers, Sizes, Spacing } from '../../styles' @@ -25,6 +26,7 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => { const [shouldShowInfo, setShouldShowInfo] = useState(false) const getParsedData = () => JSON.parse(JSON.stringify(data)) const onPressLearnMore = () => setShouldShowInfo(!shouldShowInfo) + const isFertilityTrackingEnabled = fertilityTrackingObservable.value const onEditNote = (note) => { const parsedData = getParsedData() @@ -167,15 +169,18 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => { ) })} - {shouldShow(symptomConfig.excludeText) && ( - - - - )} + {/* show exclude AppSwitch for bleeding, mucus, cervix, temperature */} + {/* but if fertility is off only for bleeding */} + {shouldShow(symptomConfig.excludeText) && + (symptom === 'bleeding' || isFertilityTrackingEnabled) && ( + + + + )} {shouldShow(symptomConfig.note) && ( {symtomPage[symptom].note} diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index d1381aa..733a62d 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -1,10 +1,12 @@ import React, { useEffect, useState } from 'react' -import { Alert, Pressable } from 'react-native' +import { Alert, Pressable, StyleSheet, View } from 'react-native' import { useTranslation } from 'react-i18next' +import AppIcon from '../../common/app-icon' import AppPage from '../../common/app-page' import AppSwitch from '../../common/app-switch' import AppText from '../../common/app-text' +import { Colors, Spacing, Typography } from '../../../styles' import TemperatureSlider from './temperature-slider' import Segment from '../../common/segment' import TrackingCategorySwitch from '../../common/tracking-category-switch' @@ -274,6 +276,7 @@ const Settings = () => { symptom={SYMPTOMS[8]} /> + {labels.fertilityTracking.message} @@ -286,6 +289,19 @@ const Settings = () => { + + + + + + {labels.tempScale.segmentExplainer} @@ -304,16 +320,32 @@ const Settings = () => { /> - - - + + + + {labels.preOvu.title} + + {labels.preOvu.note} ) } export default Settings + +const styles = StyleSheet.create({ + icon: { + marginRight: Spacing.base, + }, + line: { + flexDirection: 'row', + alignItems: 'center', + }, + title: { + ...Typography.subtitle, + }, +}) diff --git a/components/settings/settings-menu.js b/components/settings/settings-menu.js index 773ca2e..49e0ac2 100644 --- a/components/settings/settings-menu.js +++ b/components/settings/settings-menu.js @@ -11,7 +11,6 @@ const menuItems = [ { label: 'reminders', componentName: 'Reminders' }, { label: 'dataManagement', componentName: 'DataManagement' }, { label: 'password', componentName: 'Password' }, - { label: 'info', componentName: 'Info' }, ] const SettingsMenu = ({ navigate }) => { diff --git a/i18n/en.json b/i18n/en.json index 6467b64..66108a4 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -112,19 +112,19 @@ "menuItem": { "dataManagement": { "name": "Data", - "text": "import, export or delete your data" + "text": "Import, export or delete your data" }, "customization": { "name": "Customization", - "text": "define how you want to use drip" + "text": "Define how you want to use drip" }, "password": { "name": "Password", - "text": "set or edit your password" + "text": "Set, edit or delete your password" }, "reminders": { "name": "Reminders", - "text": "turn on/off reminders" + "text": "Turn on/off reminders" }, "info": { "name": "Info", diff --git a/i18n/en/cycle-day.js b/i18n/en/cycle-day.js index 1395f12..3505f56 100644 --- a/i18n/en/cycle-day.js +++ b/i18n/en/cycle-day.js @@ -4,70 +4,71 @@ export const intensity = ['low', 'medium', 'high'] export const bleeding = { labels: ['spotting', 'light', 'medium', 'heavy'], heaviness: { - header: "Heaviness", - explainer: "How heavy is the bleeding?", + header: 'Heaviness', + explainer: 'How heavy is the bleeding?', }, exclude: { - header: "Exclude", - explainer: "You can exclude this value if it's not menstrual bleeding" - } + header: 'Exclude', + explainer: "You can exclude this value if it's not menstrual bleeding", + }, } export const cervix = { subcategories: { opening: 'opening', firmness: 'firmness', - position: 'position' + position: 'position', }, opening: { categories: ['closed', 'medium', 'open'], - explainer: 'Is your cervix open or closed?' + explainer: 'Is your cervix open or closed?', }, firmness: { categories: ['hard', 'soft'], - explainer: "When it's hard, it might feel like the tip of your nose" + explainer: "When it's hard, it might feel like the tip of your nose", }, position: { categories: ['low', 'medium', 'high'], - explainer: 'How high up in the vagina is the cervix?' + explainer: 'How high up in the vagina is the cervix?', }, - excludeExplainer: "You can exclude this value if you don't want to use it for fertility detection.", - actionHint: 'Choose values for at least "Opening" and "Firmness" to save.' + excludeExplainer: + "You can exclude this value if you don't want to use it for fertility detection.", } export const mucus = { subcategories: { feeling: 'feeling', - texture: 'texture' + texture: 'texture', }, feeling: { categories: ['dry', 'nothing', 'wet', 'slippery'], - explainer: 'What does your vaginal entrance feel like?' + explainer: 'What does your vaginal entrance feel like?', }, texture: { categories: ['nothing', 'creamy', 'egg white'], - explainer: "Looking at and touching your cervical mucus, which describes it best?" + explainer: + 'Looking at and touching your cervical mucus, which describes it best?', }, - excludeExplainer: "You can exclude this value if you don't want to use it for fertility detection", - actionHint: 'Choose values for both "Feeling" and "Texture" to save.' + excludeExplainer: + "You can exclude this value if you don't want to use it for fertility detection", } export const desire = { header: 'Intensity', - explainer: 'How would you rate your sexual desire?' + explainer: 'How would you rate your sexual desire?', } export const sex = { - categories:{ + categories: { solo: 'solo', partner: 'partner', }, - header: "Activity", + header: 'Activity', explainer: 'Were you sexually active today?', } export const contraceptives = { - categories:{ + categories: { condom: 'condom', pill: 'pill', iud: 'iud', @@ -78,8 +79,8 @@ export const contraceptives = { none: 'none', other: 'other', }, - header: "Contraceptives", - explainer: 'Did you use contraceptives?' + header: 'Contraceptives', + explainer: 'Did you use contraceptives?', } export const pain = { @@ -91,9 +92,9 @@ export const pain = { nausea: 'nausea', tenderBreasts: 'tender breasts', migraine: 'migraine', - other: 'other' + other: 'other', }, - explainer: 'How did your body feel today?' + explainer: 'How did your body feel today?', } export const mood = { @@ -107,34 +108,39 @@ export const mood = { energetic: 'energetic', fatigue: 'fatigue', angry: 'angry', - other: 'other' + other: 'other', }, - explainer: 'How did you feel today?' + explainer: 'How did you feel today?', } export const temperature = { - outOfRangeWarning: 'This temperature value is out of the current range for the temperature chart. You can change the range in the settings.', - outOfAbsoluteRangeWarning: 'This temperature value is too high or low to be shown on the temperature chart.', + outOfRangeWarning: + 'This temperature value is out of the current range for the temperature chart. You can change the range in the settings.', + outOfAbsoluteRangeWarning: + 'This temperature value is too high or low to be shown on the temperature chart.', temperature: { - header: "Temperature", - explainer: 'Take your temperature right after waking up, before getting out of bed' + header: 'Temperature', + explainer: + 'Take your temperature right after waking up, before getting out of bed', }, - time: "Time", + time: 'Time', note: { - header: "Note", - explainer: 'Is there anything that could have influenced this value, such as bad sleep or alcohol consumption?' + header: 'Note', + explainer: + 'Is there anything that could have influenced this value, such as bad sleep or alcohol consumption?', }, exclude: { - header: "Exclude", - explainer: "You can exclude this value if you don't want to use it for fertility detection" - } + header: 'Exclude', + explainer: + "You can exclude this value if you don't want to use it for fertility detection", + }, } -export const noteExplainer = "Anything you want to add for the day?" +export const noteExplainer = 'Anything you want to add for the day?' export const general = { - cycleDayNumber: "Cycle day ", - today: "Today" + cycleDayNumber: 'Cycle day ', + today: 'Today', } export const sharedDialogs = { @@ -144,5 +150,5 @@ export const sharedDialogs = { reallyDeleteData: 'Yes, I am sure', save: 'Save', delete: 'Delete', - disabledInfo: 'There is some data missing' + disabledInfo: 'There is some data missing', } diff --git a/i18n/en/settings.js b/i18n/en/settings.js index 8d2181e..7f00368 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -4,6 +4,7 @@ export default { customization: { title: 'Customization', trackingCategories: 'Tracking categories', + subheaderSymptoThermalMethod: 'Sympto-thermal method settings', }, export: { errors: { diff --git a/styles/spacing.js b/styles/spacing.js index 9c54ca9..7e418f6 100644 --- a/styles/spacing.js +++ b/styles/spacing.js @@ -1,10 +1,11 @@ import { scale } from 'react-native-size-matters' export default { + zero: '0%', tiny: scale(4), small: scale(10), base: scale(16), large: scale(20), symptomTileWidth: '48%', - textWidth: '70%' + textWidth: '70%', }