Rename shouldUseCervix to useCervixAsSecondarySymptom
This commit is contained in:
@@ -35,9 +35,8 @@ import labels from '../../../i18n/en/settings'
|
|||||||
import { SYMPTOMS } from '../../../config'
|
import { SYMPTOMS } from '../../../config'
|
||||||
|
|
||||||
const Settings = () => {
|
const Settings = () => {
|
||||||
const [shouldUseCervix, setShouldUseCervix] = useState(
|
const [useCervixAsSecondarySymptom, setUseCervixAsSecondarySymptom] =
|
||||||
useCervixAsSecondarySymptomObservable.value
|
useState(useCervixAsSecondarySymptomObservable.value)
|
||||||
)
|
|
||||||
|
|
||||||
const [isPeriodPredictionEnabled, setPeriodPrediction] = useState(
|
const [isPeriodPredictionEnabled, setPeriodPrediction] = useState(
|
||||||
periodPredictionObservable.value
|
periodPredictionObservable.value
|
||||||
@@ -135,7 +134,7 @@ const Settings = () => {
|
|||||||
|
|
||||||
const onSelectTab = (value) => {
|
const onSelectTab = (value) => {
|
||||||
if (isMucusTrackingCategoryEnabled && isCervixTrackingCategoryEnabled) {
|
if (isMucusTrackingCategoryEnabled && isCervixTrackingCategoryEnabled) {
|
||||||
setShouldUseCervix(value)
|
setUseCervixAsSecondarySymptom(value)
|
||||||
saveUseCervixAsSecondarySymptom(value)
|
saveUseCervixAsSecondarySymptom(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -151,12 +150,12 @@ const Settings = () => {
|
|||||||
// shoutUseCervix changed to 0/1 instead of false/true
|
// shoutUseCervix changed to 0/1 instead of false/true
|
||||||
const manageSecondarySymptom = (cervix, mucus) => {
|
const manageSecondarySymptom = (cervix, mucus) => {
|
||||||
if (!cervix && mucus) {
|
if (!cervix && mucus) {
|
||||||
setShouldUseCervix(0)
|
setUseCervixAsSecondarySymptom(0)
|
||||||
setIsSecondarySymptomDisabled(false)
|
setIsSecondarySymptomDisabled(false)
|
||||||
} else if (cervix && mucus) {
|
} else if (cervix && mucus) {
|
||||||
setIsSecondarySymptomDisabled(false)
|
setIsSecondarySymptomDisabled(false)
|
||||||
} else if (cervix && !mucus) {
|
} else if (cervix && !mucus) {
|
||||||
setShouldUseCervix(1)
|
setUseCervixAsSecondarySymptom(1)
|
||||||
setIsSecondarySymptomDisabled(false)
|
setIsSecondarySymptomDisabled(false)
|
||||||
} else if (!cervix && !mucus) {
|
} else if (!cervix && !mucus) {
|
||||||
setIsSecondarySymptomDisabled(true)
|
setIsSecondarySymptomDisabled(true)
|
||||||
@@ -165,7 +164,7 @@ const Settings = () => {
|
|||||||
saveMucusTrackingCategory(mucus)
|
saveMucusTrackingCategory(mucus)
|
||||||
setCervixTrackingCategory(cervix)
|
setCervixTrackingCategory(cervix)
|
||||||
saveCervixTrackingCategory(cervix)
|
saveCervixTrackingCategory(cervix)
|
||||||
saveUseCervixAsSecondarySymptom(shouldUseCervix)
|
saveUseCervixAsSecondarySymptom(useCervixAsSecondarySymptom)
|
||||||
}
|
}
|
||||||
|
|
||||||
const secSymptomDisabledPrompt = () => {
|
const secSymptomDisabledPrompt = () => {
|
||||||
@@ -177,7 +176,7 @@ const Settings = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const cervixText = shouldUseCervix
|
const cervixText = useCervixAsSecondarySymptom
|
||||||
? labels.secondarySymptom.cervixModeOn
|
? labels.secondarySymptom.cervixModeOn
|
||||||
: labels.secondarySymptom.cervixModeOff
|
: labels.secondarySymptom.cervixModeOff
|
||||||
|
|
||||||
@@ -279,7 +278,7 @@ const Settings = () => {
|
|||||||
<>
|
<>
|
||||||
<AppText>{cervixText}</AppText>
|
<AppText>{cervixText}</AppText>
|
||||||
<SelectTabGroup
|
<SelectTabGroup
|
||||||
activeButton={shouldUseCervix}
|
activeButton={useCervixAsSecondarySymptom}
|
||||||
buttons={secondarySymptomButtons}
|
buttons={secondarySymptomButtons}
|
||||||
onSelect={(value) => onSelectTab(value)}
|
onSelect={(value) => onSelectTab(value)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user