From cbaf6977f6cd675fe5b6e6366f095306bc6bf693 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Thu, 22 Feb 2024 13:22:41 +0100 Subject: [PATCH] Add trackColor to Switch element directly --- components/common/app-switch.js | 6 +++--- components/settings/customization/index.js | 10 ---------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/components/common/app-switch.js b/components/common/app-switch.js index 3c100fe..d45758f 100644 --- a/components/common/app-switch.js +++ b/components/common/app-switch.js @@ -4,9 +4,10 @@ import PropTypes from 'prop-types' import AppText from './app-text' -import { Containers } from '../../styles' +import { Colors, Containers } from '../../styles' -const AppSwitch = ({ onToggle, text, value, trackColor, disabled }) => { +const AppSwitch = ({ onToggle, text, value, disabled }) => { + const trackColor = { true: Colors.turquoiseDark } return ( @@ -27,7 +28,6 @@ AppSwitch.propTypes = { onToggle: PropTypes.func.isRequired, text: PropTypes.string, value: PropTypes.bool, - trackColor: PropTypes.string, disabled: PropTypes.bool, } diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index a8e0ab2..136e8f1 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -25,7 +25,6 @@ import { periodPredictionObservable, useCervixObservable, } from '../../../local-storage' -import { Colors } from '../../../styles' import labels from '../../../i18n/en/settings' import { SYMPTOMS } from '../../../config' @@ -121,37 +120,31 @@ const Settings = () => { onToggle={temperatureTrackingCategoryToggle} text={SYMPTOMS[1]} value={isTemperatureTrackingCategoryEnabled} - trackColor={{ true: Colors.turquoiseDark }} /> @@ -160,7 +153,6 @@ const Settings = () => { onToggle={toggleSwitch} text={'If turned on ...'} value={isEnabled} - trackColor={{ true: Colors.turquoiseDark }} /> @@ -185,7 +177,6 @@ const Settings = () => { onToggle={onCervixToggle} text={cervixText} value={shouldUseCervix} - trackColor={{ true: Colors.turquoiseDark }} /> )} {!isTemperatureTrackingCategoryEnabled && ( @@ -199,7 +190,6 @@ const Settings = () => { onToggle={onPeriodPredictionToggle} text={periodPredictionText} value={isPeriodPredictionEnabled} - trackColor={{ true: Colors.turquoiseDark }} />