From 7c4e3d7bdac7dce258ce162675c28a854d9ef1c1 Mon Sep 17 00:00:00 2001 From: Sahil Date: Sat, 18 Jan 2025 22:28:54 +0530 Subject: [PATCH] revert --- .../workflows/ToggleSettingsOptionRow.tsx | 27 +++---------------- 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/src/pages/workspace/workflows/ToggleSettingsOptionRow.tsx b/src/pages/workspace/workflows/ToggleSettingsOptionRow.tsx index acad531db94c..26c6275e197f 100644 --- a/src/pages/workspace/workflows/ToggleSettingsOptionRow.tsx +++ b/src/pages/workspace/workflows/ToggleSettingsOptionRow.tsx @@ -1,9 +1,7 @@ import type {ReactNode} from 'react'; -import React, {useEffect, useMemo} from 'react'; +import React, {useMemo} from 'react'; import {View} from 'react-native'; import type {StyleProp, TextStyle, ViewStyle} from 'react-native'; -import {useSharedValue} from 'react-native-reanimated'; -import Accordion from '@components/Accordion'; import Icon from '@components/Icon'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; import RenderHTML from '@components/RenderHTML'; @@ -48,9 +46,6 @@ type ToggleSettingOptionRowProps = { /** Used to apply styles to the Subtitle */ subtitleStyle?: StyleProp; - /** Used to apply styles to the Accordion */ - accordionStyle?: StyleProp; - /** Whether the option is enabled or not */ isActive: boolean; @@ -86,7 +81,6 @@ function ToggleSettingOptionRow({ customTitle, subtitle, subtitleStyle, - accordionStyle, switchAccessibilityLabel, shouldPlaceSubtitleBelowSwitch, shouldEscapeText = undefined, @@ -104,12 +98,6 @@ function ToggleSettingOptionRow({ showLockIcon = false, }: ToggleSettingOptionRowProps) { const styles = useThemeStyles(); - const isExpanded = useSharedValue(isActive); - const isToggleTriggered = useSharedValue(false); - - useEffect(() => { - isExpanded.set(isActive); - }, [isExpanded, isActive]); const subtitleHtml = useMemo(() => { if (!subtitle || !shouldParseSubtitle || typeof subtitle !== 'string') { @@ -183,23 +171,14 @@ function ToggleSettingOptionRow({ { - isToggleTriggered.set(true); - onToggle(isOn); - }} + onToggle={onToggle} isOn={isActive} disabled={disabled} showLockIcon={showLockIcon} /> {shouldPlaceSubtitleBelowSwitch && subtitle && subTitleView} - - {subMenuItems} - + {isActive && subMenuItems} );