diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 061db10e8dd7a..223487205e5d1 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -204,8 +204,6 @@ const CONST = { ANIMATED_HIGHLIGHT_ENTRY_DURATION: 300, ANIMATED_HIGHLIGHT_START_DELAY: 10, ANIMATED_HIGHLIGHT_START_DURATION: 300, - ANIMATED_HIGHLIGHT_WORKSPACE_FEATURE_ITEM_END_DELAY: 7000, - ANIMATED_HIGHLIGHT_WORKSPACE_FEATURE_ITEM_END_DURATION: 3000, ANIMATED_HIGHLIGHT_END_DELAY: 800, ANIMATED_HIGHLIGHT_END_DURATION: 2000, ANIMATED_TRANSITION: 300, diff --git a/src/components/HighlightableMenuItem.tsx b/src/components/HighlightableMenuItem.tsx index cf4f65378210b..983acf6fb02bf 100644 --- a/src/components/HighlightableMenuItem.tsx +++ b/src/components/HighlightableMenuItem.tsx @@ -3,9 +3,7 @@ import React, {forwardRef} from 'react'; import type {View} from 'react-native'; import {StyleSheet} from 'react-native'; import useAnimatedHighlightStyle from '@hooks/useAnimatedHighlightStyle'; -import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; -import CONST from '@src/CONST'; import MenuItem from './MenuItem'; import type {MenuItemProps} from './MenuItem'; @@ -16,16 +14,12 @@ type Props = MenuItemProps & { function HighlightableMenuItem({wrapperStyle, highlighted, ...restOfProps}: Props, ref: ForwardedRef) { const styles = useThemeStyles(); - const theme = useTheme(); const flattenedWrapperStyles = StyleSheet.flatten(wrapperStyle); const animatedHighlightStyle = useAnimatedHighlightStyle({ shouldHighlight: highlighted ?? false, height: flattenedWrapperStyles?.height ? Number(flattenedWrapperStyles.height) : styles.sectionMenuItem.height, borderRadius: flattenedWrapperStyles?.borderRadius ? Number(flattenedWrapperStyles.borderRadius) : styles.sectionMenuItem.borderRadius, - highlightColor: theme.messageHighlightBG, - highlightEndDelay: CONST.ANIMATED_HIGHLIGHT_WORKSPACE_FEATURE_ITEM_END_DELAY, - highlightEndDuration: CONST.ANIMATED_HIGHLIGHT_WORKSPACE_FEATURE_ITEM_END_DURATION, }); return ( diff --git a/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx b/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx index 9640b74e9c88a..6c966d96000d7 100644 --- a/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx +++ b/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx @@ -2,7 +2,6 @@ import React, {useCallback, useEffect, useState} from 'react'; import {View} from 'react-native'; import ConfirmModal from '@components/ConfirmModal'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import Hoverable from '@components/Hoverable'; import * as Illustrations from '@components/Icon/Illustrations'; import ScreenWrapper from '@components/ScreenWrapper'; import ScrollView from '@components/ScrollView'; @@ -68,7 +67,6 @@ type Item = { pendingAction: PendingAction | undefined; errors?: Errors; onCloseError?: () => void; - onPress?: () => void; }; type SectionObject = { @@ -149,12 +147,6 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro } enablePolicyDistanceRates(policyID, isEnabled, distanceRateCustomUnit); }, - onPress: () => { - if (!policyID) { - return; - } - Navigation.navigate(ROUTES.WORKSPACE_DISTANCE_RATES.getRoute(policyID)); - }, }, { icon: illustrations.HandCard, @@ -172,12 +164,6 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro disabledAction: () => { setIsDisableExpensifyCardWarningModalOpen(true); }, - onPress: () => { - if (!policyID) { - return; - } - Navigation.navigate(ROUTES.WORKSPACE_EXPENSIFY_CARD.getRoute(policyID)); - }, }, ]; @@ -197,12 +183,6 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro disabledAction: () => { setIsDisableCompanyCardsWarningModalOpen(true); }, - onPress: () => { - if (!policyID) { - return; - } - Navigation.navigate(ROUTES.WORKSPACE_COMPANY_CARDS.getRoute(policyID)); - }, }); spendItems.push({ @@ -221,12 +201,6 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro } enablePerDiem(policyID, isEnabled, perDiemCustomUnit?.customUnitID, true, quickAction); }, - onPress: () => { - if (!policyID) { - return; - } - Navigation.navigate(ROUTES.WORKSPACE_PER_DIEM.getRoute(policyID)); - }, }); const manageItems: Item[] = [ @@ -244,12 +218,6 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro }, disabled: isSmartLimitEnabled, disabledAction: onDisabledWorkflowPress, - onPress: () => { - if (!policyID) { - return; - } - Navigation.navigate(ROUTES.WORKSPACE_WORKFLOWS.getRoute(policyID)); - }, }, { icon: illustrations.Rules, @@ -268,12 +236,6 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro } enablePolicyRules(policyID, isEnabled); }, - onPress: () => { - if (!policyID) { - return; - } - Navigation.navigate(ROUTES.WORKSPACE_RULES.getRoute(policyID)); - }, }, ]; @@ -290,12 +252,6 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro } enablePolicyInvoicing(policyID, isEnabled); }, - onPress: () => { - if (!policyID) { - return; - } - Navigation.navigate(ROUTES.WORKSPACE_INVOICES.getRoute(policyID)); - }, }, ]; @@ -314,12 +270,6 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro } enablePolicyCategories(policyID, isEnabled, policyTagLists, policyCategories, allTransactionViolations, true); }, - onPress: () => { - if (!policyID) { - return; - } - Navigation.navigate(ROUTES.WORKSPACE_CATEGORIES.getRoute(policyID)); - }, }, { icon: illustrations.Tag, @@ -335,12 +285,6 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro } enablePolicyTags({policyID, enabled: isEnabled, policyTags: policyTagLists}); }, - onPress: () => { - if (!policyID) { - return; - } - Navigation.navigate(ROUTES.WORKSPACE_TAGS.getRoute(policyID)); - }, }, { icon: illustrations.Coins, @@ -356,12 +300,6 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro } enablePolicyTaxes(policyID, isEnabled); }, - onPress: () => { - if (!policyID) { - return; - } - Navigation.navigate(ROUTES.WORKSPACE_TAXES.getRoute(policyID)); - }, }, ]; @@ -392,12 +330,6 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro } clearPolicyErrorField(policyID, CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED); }, - onPress: () => { - if (!policyID) { - return; - } - Navigation.navigate(ROUTES.POLICY_ACCOUNTING.getRoute(policyID)); - }, }, ]; @@ -428,12 +360,6 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro } clearPolicyErrorField(policyID, CONST.POLICY.MORE_FEATURES.ARE_RECEIPT_PARTNERS_ENABLED); }, - onPress: () => { - if (!policyID) { - return; - } - Navigation.navigate(ROUTES.WORKSPACE_RECEIPT_PARTNERS.getRoute(policyID)); - }, }); } @@ -467,36 +393,26 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro const renderItem = useCallback( (item: Item) => ( - - {(hovered) => ( - - - - )} - + + + ), [styles, StyleUtils, shouldUseNarrowLayout, translate], ); diff --git a/src/pages/workspace/workflows/ToggleSettingsOptionRow.tsx b/src/pages/workspace/workflows/ToggleSettingsOptionRow.tsx index 4b9e95ff8c77b..bbe7b83510bf0 100644 --- a/src/pages/workspace/workflows/ToggleSettingsOptionRow.tsx +++ b/src/pages/workspace/workflows/ToggleSettingsOptionRow.tsx @@ -5,7 +5,6 @@ import type {StyleProp, TextStyle, ViewStyle} from 'react-native'; import Accordion from '@components/Accordion'; import Icon from '@components/Icon'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; -import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback'; import RenderHTML from '@components/RenderHTML'; import Switch from '@components/Switch'; import Text from '@components/Text'; @@ -78,9 +77,6 @@ type ToggleSettingOptionRowProps = { /** Callback to fire when the switch is toggled in disabled state */ disabledAction?: () => void; - - /** Callback to fire when the content area is pressed (only works when isActive is true) */ - onPress?: () => void; }; const ICON_SIZE = 48; @@ -106,7 +102,6 @@ function ToggleSettingOptionRow({ onCloseError, disabled = false, showLockIcon = false, - onPress, }: ToggleSettingOptionRowProps) { const styles = useThemeStyles(); const {isAccordionExpanded, shouldAnimateAccordionSection} = useAccordionAnimation(isActive); @@ -158,27 +153,6 @@ function ToggleSettingOptionRow({ processedSubtitle, ]); - const contentArea = ( - - {!!icon && ( - - )} - {customTitle ?? ( - - {title} - {!shouldPlaceSubtitleBelowSwitch && subtitle && subTitleView} - - )} - - ); - - const shouldMakeContentPressable = isActive && onPress; - return ( - {shouldMakeContentPressable ? ( - - {contentArea} - - ) : ( - contentArea - )} + + {!!icon && ( + + )} + {customTitle ?? ( + + {title} + {!shouldPlaceSubtitleBelowSwitch && subtitle && subTitleView} + + )} +