Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 0 additions & 81 deletions src/components/Accordion/index.native.tsx

This file was deleted.

78 changes: 0 additions & 78 deletions src/components/Accordion/index.tsx

This file was deleted.

10 changes: 2 additions & 8 deletions src/libs/Navigation/linkTo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,7 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam
}
}

if (
action &&
'payload' in action &&
action.payload &&
'name' in action.payload &&
(isSideModalNavigator(action.payload.name) || action.payload.name === NAVIGATORS.FULL_SCREEN_NAVIGATOR)
) {
if (action && 'payload' in action && action.payload && 'name' in action.payload && isSideModalNavigator(action.payload.name)) {
// Information about the state may be in the params.
const currentFocusedRoute = findFocusedRoute(extrapolateStateFromParams(rootState));
const targetFocusedRoute = findFocusedRoute(stateFromPath);
Expand All @@ -207,7 +201,7 @@ export default function linkTo(navigation: NavigationContainerRef<RootStackParam
// There are situations where a route already exists on the current navigation stack
// But we want to push the same route instead of going back in the stack
// Which would break the user navigation history
if ((!isActiveRoute && type === CONST.NAVIGATION.ACTION_TYPE.PUSH) || action.payload.name === NAVIGATORS.FULL_SCREEN_NAVIGATOR) {
if (!isActiveRoute && type === CONST.NAVIGATION.ACTION_TYPE.PUSH) {
minimalAction.type = CONST.NAVIGATION.ACTION_TYPE.PUSH;
}
root.dispatch(minimalAction);
Expand Down
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