Skip to content

Commit 7c4e3d7

Browse files
authored
revert
1 parent ea1dab1 commit 7c4e3d7

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

src/pages/workspace/workflows/ToggleSettingsOptionRow.tsx

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import type {ReactNode} from 'react';
2-
import React, {useEffect, useMemo} from 'react';
2+
import React, {useMemo} from 'react';
33
import {View} from 'react-native';
44
import type {StyleProp, TextStyle, ViewStyle} from 'react-native';
5-
import {useSharedValue} from 'react-native-reanimated';
6-
import Accordion from '@components/Accordion';
75
import Icon from '@components/Icon';
86
import OfflineWithFeedback from '@components/OfflineWithFeedback';
97
import RenderHTML from '@components/RenderHTML';
@@ -48,9 +46,6 @@ type ToggleSettingOptionRowProps = {
4846
/** Used to apply styles to the Subtitle */
4947
subtitleStyle?: StyleProp<TextStyle>;
5048

51-
/** Used to apply styles to the Accordion */
52-
accordionStyle?: StyleProp<ViewStyle>;
53-
5449
/** Whether the option is enabled or not */
5550
isActive: boolean;
5651

@@ -86,7 +81,6 @@ function ToggleSettingOptionRow({
8681
customTitle,
8782
subtitle,
8883
subtitleStyle,
89-
accordionStyle,
9084
switchAccessibilityLabel,
9185
shouldPlaceSubtitleBelowSwitch,
9286
shouldEscapeText = undefined,
@@ -104,12 +98,6 @@ function ToggleSettingOptionRow({
10498
showLockIcon = false,
10599
}: ToggleSettingOptionRowProps) {
106100
const styles = useThemeStyles();
107-
const isExpanded = useSharedValue(isActive);
108-
const isToggleTriggered = useSharedValue(false);
109-
110-
useEffect(() => {
111-
isExpanded.set(isActive);
112-
}, [isExpanded, isActive]);
113101

114102
const subtitleHtml = useMemo(() => {
115103
if (!subtitle || !shouldParseSubtitle || typeof subtitle !== 'string') {
@@ -183,23 +171,14 @@ function ToggleSettingOptionRow({
183171
<Switch
184172
disabledAction={disabledAction}
185173
accessibilityLabel={switchAccessibilityLabel}
186-
onToggle={(isOn) => {
187-
isToggleTriggered.set(true);
188-
onToggle(isOn);
189-
}}
174+
onToggle={onToggle}
190175
isOn={isActive}
191176
disabled={disabled}
192177
showLockIcon={showLockIcon}
193178
/>
194179
</View>
195180
{shouldPlaceSubtitleBelowSwitch && subtitle && subTitleView}
196-
<Accordion
197-
isExpanded={isExpanded}
198-
style={accordionStyle}
199-
isToggleTriggered={isToggleTriggered}
200-
>
201-
{subMenuItems}
202-
</Accordion>
181+
{isActive && subMenuItems}
203182
</View>
204183
</OfflineWithFeedback>
205184
);

0 commit comments

Comments
 (0)