From d23b5fe42024d8cf5d7e36ee1f68aba29084d5f6 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Wed, 14 Feb 2024 15:36:06 +0100 Subject: [PATCH] Add oneTimeTransformIntoNumber for secondarySymptom Switch --- components/cycle-day/select-tab-group.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index ef9ae03..0548977 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -8,12 +8,15 @@ import { Colors, Containers } from '../../styles' import labels from '../../i18n/en/settings' export default function SelectTabGroup({ activeButton, buttons, onSelect }) { + const oneTimeTransformIntoNumber = + typeof activeButton === 'boolean' && Number(activeButton) const isSecondarySymptomSwitch = buttons[0]['label'] === labels.useCervix.secondarySymptomCervicalMucus return ( {buttons.map(({ label, value }, i) => { - const isActive = value === activeButton + const isActive = + value === activeButton || value === oneTimeTransformIntoNumber const boxStyle = [ styles.box, isActive && styles.boxActive,