Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
thesahindia authored Jan 18, 2025
1 parent ea1dab1 commit 7c4e3d7
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions src/pages/workspace/workflows/ToggleSettingsOptionRow.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -48,9 +46,6 @@ type ToggleSettingOptionRowProps = {
/** Used to apply styles to the Subtitle */
subtitleStyle?: StyleProp<TextStyle>;

/** Used to apply styles to the Accordion */
accordionStyle?: StyleProp<ViewStyle>;

/** Whether the option is enabled or not */
isActive: boolean;

Expand Down Expand Up @@ -86,7 +81,6 @@ function ToggleSettingOptionRow({
customTitle,
subtitle,
subtitleStyle,
accordionStyle,
switchAccessibilityLabel,
shouldPlaceSubtitleBelowSwitch,
shouldEscapeText = undefined,
Expand All @@ -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') {
Expand Down Expand Up @@ -183,23 +171,14 @@ function ToggleSettingOptionRow({
<Switch
disabledAction={disabledAction}
accessibilityLabel={switchAccessibilityLabel}
onToggle={(isOn) => {
isToggleTriggered.set(true);
onToggle(isOn);
}}
onToggle={onToggle}
isOn={isActive}
disabled={disabled}
showLockIcon={showLockIcon}
/>
</View>
{shouldPlaceSubtitleBelowSwitch && subtitle && subTitleView}
<Accordion
isExpanded={isExpanded}
style={accordionStyle}
isToggleTriggered={isToggleTriggered}
>
{subMenuItems}
</Accordion>
{isActive && subMenuItems}
</View>
</OfflineWithFeedback>
);
Expand Down

0 comments on commit 7c4e3d7

Please sign in to comment.