diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index 0548977..91e87e9 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -11,7 +11,7 @@ export default function SelectTabGroup({ activeButton, buttons, onSelect }) { const oneTimeTransformIntoNumber = typeof activeButton === 'boolean' && Number(activeButton) const isSecondarySymptomSwitch = - buttons[0]['label'] === labels.useCervix.secondarySymptomCervicalMucus + buttons[0]['label'] === labels.useCervixAsSecondarySymptom.mucus return ( {buttons.map(({ label, value }, i) => { diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 7ff147a..59e5151 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -26,7 +26,7 @@ import { savePeriodPrediction, saveSexTrackingCategory, saveTemperatureTrackingCategory, - saveUseCervix, + saveUseCervixAsSecondarySymptom, periodPredictionObservable, useCervixAsSecondarySymptomObservable, } from '../../../local-storage' @@ -124,11 +124,11 @@ const Settings = () => { // used to be onCervixToggle const secondarySymptomButtons = [ { - label: labels.useCervix.secondarySymptomCervicalMucus, + label: labels.useCervixAsSecondarySymptom.mucus, value: 0, }, { - label: labels.useCervix.secondarySymptomCervix, + label: labels.useCervixAsSecondarySymptom.cervix, value: 1, }, ] @@ -136,7 +136,7 @@ const Settings = () => { const onSelectTab = (value) => { if (isMucusTrackingCategoryEnabled && isCervixTrackingCategoryEnabled) { setShouldUseCervix(value) - saveUseCervix(value) + saveUseCervixAsSecondarySymptom(value) } } @@ -165,21 +165,21 @@ const Settings = () => { saveMucusTrackingCategory(mucus) setCervixTrackingCategory(cervix) saveCervixTrackingCategory(cervix) - saveUseCervix(shouldUseCervix) + saveUseCervixAsSecondarySymptom(shouldUseCervix) } const secSymptomDisabledPrompt = () => { if (!isMucusTrackingCategoryEnabled == isCervixTrackingCategoryEnabled) { Alert.alert( - labels.useCervix.disabled.title, - labels.useCervix.disabled.noSecondaryEnabled + labels.useCervixAsSecondarySymptom.disabled.title, + labels.useCervixAsSecondarySymptom.disabled.noSecondaryEnabled ) } } const cervixText = shouldUseCervix - ? labels.useCervix.cervixModeOn - : labels.useCervix.cervixModeOff + ? labels.useCervixAsSecondarySymptom.cervixModeOn + : labels.useCervixAsSecondarySymptom.cervixModeOff const sliderDisabledPrompt = () => { if (!isTemperatureTrackingCategoryEnabled) { @@ -271,10 +271,10 @@ const Settings = () => { {/* used to be switch for onCervixToggle */} - + {!isTemperatureTrackingCategoryEnabled || isSecondarySymptomDisabled ? ( - {labels.useCervix.disabled.message} + {labels.useCervixAsSecondarySymptom.disabled.message} ) : ( <> {cervixText} diff --git a/i18n/en/settings.js b/i18n/en/settings.js index 7afa9be..918ce5a 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -66,7 +66,7 @@ export default { 'To use the period reminder please first enable period predictions in the customization settings.', }, }, - useCervix: { + useCervixAsSecondarySymptom: { title: 'Secondary symptom', cervixModeOn: 'Cervix values are being used for symptothermal fertility detection. You can switch here to use cervical mucus values for symptothermal fertility detection', @@ -79,8 +79,8 @@ export default { noSecondaryEnabled: 'To switch the secondary symptom both cervical mucus an cervix need to be enabled in the customization settings.', }, - secondarySymptomCervicalMucus: 'cervical mucus', - secondarySymptomCervix: 'cervix', + mucus: 'cervical mucus', + cervix: 'cervix', }, periodPrediction: { title: 'Period predictions', diff --git a/local-storage.js b/local-storage.js index 175a7d4..84b680d 100644 --- a/local-storage.js +++ b/local-storage.js @@ -60,10 +60,17 @@ export async function savePeriodPrediction(bool) { } export const useCervixAsSecondarySymptomObservable = Observable() -setObvWithInitValue('useCervix', useCervixAsSecondarySymptomObservable, 0) +setObvWithInitValue( + 'useCervixAsSecondarySymptom', + useCervixAsSecondarySymptomObservable, + 0 +) -export async function saveUseCervix(value) { - await AsyncStorage.setItem('useCervix', JSON.stringify(value)) +export async function saveUseCervixAsSecondarySymptom(value) { + await AsyncStorage.setItem( + 'useCervixAsSecondarySymptom', + JSON.stringify(value) + ) useCervixAsSecondarySymptomObservable.set(value) }