diff --git a/src/components/SelectionListWithSections/Search/ActionCell/BadgeActionCell.tsx b/src/components/SelectionListWithSections/Search/ActionCell/BadgeActionCell.tsx deleted file mode 100644 index 66b3acb0f07f..000000000000 --- a/src/components/SelectionListWithSections/Search/ActionCell/BadgeActionCell.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import React from 'react'; -import {View} from 'react-native'; -import Badge from '@components/Badge'; -import useLocalize from '@hooks/useLocalize'; -import useStyleUtils from '@hooks/useStyleUtils'; -import useTheme from '@hooks/useTheme'; -import useThemeStyles from '@hooks/useThemeStyles'; -import variables from '@styles/variables'; -import CONST from '@src/CONST'; -import type {SearchTransactionAction} from '@src/types/onyx/SearchResults'; -import actionTranslationsMap from './actionTranslationsMap'; - -type BadgeActionCellProps = { - action: SearchTransactionAction; - isLargeScreenWidth: boolean; - shouldDisablePointerEvents?: boolean; -}; - -function BadgeActionCell({action, isLargeScreenWidth, shouldDisablePointerEvents}: BadgeActionCellProps) { - const {translate} = useLocalize(); - const theme = useTheme(); - const styles = useThemeStyles(); - const StyleUtils = useStyleUtils(); - const text = translate(actionTranslationsMap[action]); - - const badgeTheme = action === CONST.SEARCH.ACTION_TYPES.PAID ? theme.reportStatusBadge.paid : theme.reportStatusBadge.closed; - - return ( - - - - ); -} - -export type {BadgeActionCellProps}; -export default BadgeActionCell; diff --git a/src/components/SelectionListWithSections/Search/ActionCell/index.tsx b/src/components/SelectionListWithSections/Search/ActionCell/index.tsx index bf8547071771..1ab70eeac6ea 100644 --- a/src/components/SelectionListWithSections/Search/ActionCell/index.tsx +++ b/src/components/SelectionListWithSections/Search/ActionCell/index.tsx @@ -6,16 +6,13 @@ import useThemeStyles from '@hooks/useThemeStyles'; import CONST from '@src/CONST'; import type {SearchTransactionAction} from '@src/types/onyx/SearchResults'; import actionTranslationsMap from './actionTranslationsMap'; -import BadgeActionCell from './BadgeActionCell'; import PayActionCell from './PayActionCell'; type ActionCellProps = { action?: SearchTransactionAction; - isLargeScreenWidth?: boolean; isSelected?: boolean; goToItem: () => void; isChildListItem?: boolean; - parentAction?: string; isLoading?: boolean; policyID?: string; reportID?: string; @@ -27,11 +24,9 @@ type ActionCellProps = { function ActionCell({ action = CONST.SEARCH.ACTION_TYPES.VIEW, - isLargeScreenWidth = true, isSelected = false, goToItem, isChildListItem = false, - parentAction = '', isLoading = false, policyID = '', reportID = '', @@ -44,24 +39,13 @@ function ActionCell({ const styles = useThemeStyles(); const {isOffline} = useNetwork(); - const shouldUseViewAction = action === CONST.SEARCH.ACTION_TYPES.VIEW || (parentAction === CONST.SEARCH.ACTION_TYPES.PAID && action === CONST.SEARCH.ACTION_TYPES.PAID); - const isBadgeAction = !isChildListItem && ((parentAction !== CONST.SEARCH.ACTION_TYPES.PAID && action === CONST.SEARCH.ACTION_TYPES.PAID) || action === CONST.SEARCH.ACTION_TYPES.DONE); + const shouldUseViewAction = action === CONST.SEARCH.ACTION_TYPES.VIEW || action === CONST.SEARCH.ACTION_TYPES.PAID || action === CONST.SEARCH.ACTION_TYPES.DONE; - if (isBadgeAction) { - return ( - - ); - } - - if (action === CONST.SEARCH.ACTION_TYPES.VIEW || shouldUseViewAction || isChildListItem) { - const text = isChildListItem ? translate(actionTranslationsMap[CONST.SEARCH.ACTION_TYPES.VIEW]) : translate(actionTranslationsMap[action]); + if (shouldUseViewAction || isChildListItem) { + const text = translate(actionTranslationsMap[CONST.SEARCH.ACTION_TYPES.VIEW]); const buttonInnerStyles = isSelected ? styles.buttonDefaultSelected : {}; - return isLargeScreenWidth ? ( + return (