Add oneTimeTransformIntoNumber for secondarySymptom Switch
This commit is contained in:
@@ -8,12 +8,15 @@ import { Colors, Containers } from '../../styles'
|
|||||||
import labels from '../../i18n/en/settings'
|
import labels from '../../i18n/en/settings'
|
||||||
|
|
||||||
export default function SelectTabGroup({ activeButton, buttons, onSelect }) {
|
export default function SelectTabGroup({ activeButton, buttons, onSelect }) {
|
||||||
|
const oneTimeTransformIntoNumber =
|
||||||
|
typeof activeButton === 'boolean' && Number(activeButton)
|
||||||
const isSecondarySymptomSwitch =
|
const isSecondarySymptomSwitch =
|
||||||
buttons[0]['label'] === labels.useCervix.secondarySymptomCervicalMucus
|
buttons[0]['label'] === labels.useCervix.secondarySymptomCervicalMucus
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
{buttons.map(({ label, value }, i) => {
|
{buttons.map(({ label, value }, i) => {
|
||||||
const isActive = value === activeButton
|
const isActive =
|
||||||
|
value === activeButton || value === oneTimeTransformIntoNumber
|
||||||
const boxStyle = [
|
const boxStyle = [
|
||||||
styles.box,
|
styles.box,
|
||||||
isActive && styles.boxActive,
|
isActive && styles.boxActive,
|
||||||
|
|||||||
Reference in New Issue
Block a user