From bef52de0b27d5845cd3e67534b3d0302ee849426 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Wed, 3 Apr 2024 22:10:24 +0100 Subject: [PATCH 1/5] Make sure the style for distance rates row is same as for categories and other features --- src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx b/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx index faa766945452..e9df3d47b4cb 100644 --- a/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx +++ b/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx @@ -106,7 +106,7 @@ function PolicyDistanceRatesPage({policy, route}: PolicyDistanceRatesPageProps) errors: value.errors ?? undefined, rightElement: ( - + {value.enabled ? translate('workspace.distanceRates.enabled') : translate('workspace.distanceRates.disabled')} From 83dd287900a65a7ba8c1abc41cb1866dd670f5cb Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Wed, 3 Apr 2024 22:27:01 +0100 Subject: [PATCH 2/5] Fix lint --- src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx b/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx index e9df3d47b4cb..bbc5d81e3d2d 100644 --- a/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx +++ b/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx @@ -118,7 +118,7 @@ function PolicyDistanceRatesPage({policy, route}: PolicyDistanceRatesPageProps) ), })), - [customUnit?.attributes?.unit, customUnitRates, selectedDistanceRates, styles.alignSelfCenter, styles.flexRow, styles.p1, styles.pl2, styles.textSupporting, theme.icon, translate], + [customUnit?.attributes?.unit, customUnitRates, selectedDistanceRates, styles.alignSelfCenter, styles.flexRow, styles.p1, styles.pl2, styles.textSupporting, styles.label, theme.icon, translate], ); const addRate = () => { From 2252271e720be48e76bf4bdf1ca8c8a1b0dcce1b Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Thu, 4 Apr 2024 00:35:00 +0100 Subject: [PATCH 3/5] Create a new component for the right element --- .../ListItemRightElementWithArrow.tsx | 36 +++++++++++++++++++ src/languages/en.ts | 2 -- src/languages/es.ts | 2 -- .../distanceRates/PolicyDistanceRatesPage.tsx | 21 +++++------ 4 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 src/components/SelectionList/ListItemRightElementWithArrow.tsx diff --git a/src/components/SelectionList/ListItemRightElementWithArrow.tsx b/src/components/SelectionList/ListItemRightElementWithArrow.tsx new file mode 100644 index 000000000000..c8c4505c5305 --- /dev/null +++ b/src/components/SelectionList/ListItemRightElementWithArrow.tsx @@ -0,0 +1,36 @@ +import React from 'react'; +import {View} from 'react-native'; +import Icon from '@components/Icon'; +import useTheme from '@hooks/useTheme'; +import useThemeStyles from '@hooks/useThemeStyles'; +import Text from '@components/Text'; +import useLocalize from '@hooks/useLocalize'; +import * as Expensicons from '@components/Icon/Expensicons'; + +type ListItemRightElementWithArrowProps = { + enabled?: boolean; +}; + +function ListItemRightElementWithArrow({enabled}: ListItemRightElementWithArrowProps) { + const styles = useThemeStyles(); + const theme = useTheme(); + const {translate} = useLocalize(); + + return ( + + + {enabled ? translate('workspace.common.enabled') : translate('workspace.common.disabled')} + + + + + + ); +} + +ListItemRightElementWithArrow.displayName = 'ListItemRightElementWithArrow'; + +export default ListItemRightElementWithArrow; diff --git a/src/languages/en.ts b/src/languages/en.ts index 752d17e37d03..10793e43c884 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -2073,8 +2073,6 @@ export default { disableRates: ({count}: DistanceRateOperationsParams) => `Disable ${Str.pluralize('rate', 'rates', count)}`, enableRate: 'Enable rate', status: 'Status', - enabled: 'Enabled', - disabled: 'Disabled', unit: 'Unit', defaultCategory: 'Default category', deleteDistanceRate: 'Delete distance rate', diff --git a/src/languages/es.ts b/src/languages/es.ts index 53ee6d3fba79..af19e89e4635 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2101,8 +2101,6 @@ export default { disableRates: ({count}: DistanceRateOperationsParams) => `Desactivar ${Str.pluralize('tasa', 'tasas', count)}`, enableRate: 'Activar tasa', status: 'Estado', - enabled: 'Activada', - disabled: 'Desactivada', unit: 'Unidad', defaultCategory: 'Categoría predeterminada', deleteDistanceRate: 'Eliminar tasa de distancia', diff --git a/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx b/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx index bbc5d81e3d2d..13dd8f6d718d 100644 --- a/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx +++ b/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx @@ -8,12 +8,12 @@ import Button from '@components/Button'; import type {DropdownOption, WorkspaceDistanceRatesBulkActionType} from '@components/ButtonWithDropdownMenu/types'; import ConfirmModal from '@components/ConfirmModal'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; import ScreenWrapper from '@components/ScreenWrapper'; import SelectionList from '@components/SelectionList'; import TableListItem from '@components/SelectionList/TableListItem'; +import ListItemRightElementWithArrow from '@components/SelectionList/ListItemRightElementWithArrow'; import type {ListItem} from '@components/SelectionList/types'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; @@ -105,20 +105,15 @@ function PolicyDistanceRatesPage({policy, route}: PolicyDistanceRatesPageProps) pendingAction: value.pendingAction ?? value.pendingFields?.rate ?? value.pendingFields?.enabled ?? value.pendingFields?.currency, errors: value.errors ?? undefined, rightElement: ( - - - {value.enabled ? translate('workspace.distanceRates.enabled') : translate('workspace.distanceRates.disabled')} - - - - - + ), })), - [customUnit?.attributes?.unit, customUnitRates, selectedDistanceRates, styles.alignSelfCenter, styles.flexRow, styles.p1, styles.pl2, styles.textSupporting, styles.label, theme.icon, translate], + [ + customUnit?.attributes?.unit, + customUnitRates, + selectedDistanceRates, + translate, + ], ); const addRate = () => { From 4290391d0d9d50d6d7da30624d537652be5c8036 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Thu, 4 Apr 2024 00:37:53 +0100 Subject: [PATCH 4/5] Create a new component for the right element --- .../ListItemRightElementWithArrow.tsx | 6 ++-- .../categories/WorkspaceCategoriesPage.tsx | 30 ++----------------- .../distanceRates/PolicyDistanceRatesPage.tsx | 13 ++------ .../workspace/tags/WorkspaceTagsPage.tsx | 18 ++--------- .../workspace/taxes/WorkspaceTaxesPage.tsx | 16 ++-------- 5 files changed, 15 insertions(+), 68 deletions(-) diff --git a/src/components/SelectionList/ListItemRightElementWithArrow.tsx b/src/components/SelectionList/ListItemRightElementWithArrow.tsx index c8c4505c5305..f112d97af2ee 100644 --- a/src/components/SelectionList/ListItemRightElementWithArrow.tsx +++ b/src/components/SelectionList/ListItemRightElementWithArrow.tsx @@ -1,11 +1,11 @@ import React from 'react'; import {View} from 'react-native'; import Icon from '@components/Icon'; -import useTheme from '@hooks/useTheme'; -import useThemeStyles from '@hooks/useThemeStyles'; +import * as Expensicons from '@components/Icon/Expensicons'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; -import * as Expensicons from '@components/Icon/Expensicons'; +import useTheme from '@hooks/useTheme'; +import useThemeStyles from '@hooks/useThemeStyles'; type ListItemRightElementWithArrowProps = { enabled?: boolean; diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index 5b246caa6e07..4e2b91b63953 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -9,11 +9,11 @@ import ButtonWithDropdownMenu from '@components/ButtonWithDropdownMenu'; import type {DropdownOption} from '@components/ButtonWithDropdownMenu/types'; import ConfirmModal from '@components/ConfirmModal'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; import ScreenWrapper from '@components/ScreenWrapper'; import SelectionList from '@components/SelectionList'; +import ListItemRightElementWithArrow from '@components/SelectionList/ListItemRightElementWithArrow'; import TableListItem from '@components/SelectionList/TableListItem'; import type {ListItem} from '@components/SelectionList/types'; import Text from '@components/Text'; @@ -88,34 +88,10 @@ function WorkspaceCategoriesPage({policy, policyCategories, route}: WorkspaceCat isDisabled, pendingAction: value.pendingAction, errors: value.errors ?? undefined, - rightElement: ( - - - {value.enabled ? translate('workspace.common.enabled') : translate('workspace.common.disabled')} - - - - - - ), + rightElement: , }; }), - [ - policyCategories, - selectedCategories, - styles.alignSelfCenter, - styles.buttonOpacityDisabled, - styles.flexRow, - styles.label, - styles.p1, - styles.pl2, - styles.textSupporting, - theme.icon, - translate, - ], + [policyCategories, selectedCategories], ); const toggleCategory = (category: PolicyOption) => { diff --git a/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx b/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx index 13dd8f6d718d..b870b91e44da 100644 --- a/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx +++ b/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx @@ -12,8 +12,8 @@ import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; import ScreenWrapper from '@components/ScreenWrapper'; import SelectionList from '@components/SelectionList'; -import TableListItem from '@components/SelectionList/TableListItem'; import ListItemRightElementWithArrow from '@components/SelectionList/ListItemRightElementWithArrow'; +import TableListItem from '@components/SelectionList/TableListItem'; import type {ListItem} from '@components/SelectionList/types'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; @@ -104,16 +104,9 @@ function PolicyDistanceRatesPage({policy, route}: PolicyDistanceRatesPageProps) isDisabled: value.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, pendingAction: value.pendingAction ?? value.pendingFields?.rate ?? value.pendingFields?.enabled ?? value.pendingFields?.currency, errors: value.errors ?? undefined, - rightElement: ( - - ), + rightElement: , })), - [ - customUnit?.attributes?.unit, - customUnitRates, - selectedDistanceRates, - translate, - ], + [customUnit?.attributes?.unit, customUnitRates, selectedDistanceRates, translate], ); const addRate = () => { diff --git a/src/pages/workspace/tags/WorkspaceTagsPage.tsx b/src/pages/workspace/tags/WorkspaceTagsPage.tsx index 56cf00582782..1b82786a291d 100644 --- a/src/pages/workspace/tags/WorkspaceTagsPage.tsx +++ b/src/pages/workspace/tags/WorkspaceTagsPage.tsx @@ -10,11 +10,11 @@ import ButtonWithDropdownMenu from '@components/ButtonWithDropdownMenu'; import type {DropdownOption} from '@components/ButtonWithDropdownMenu/types'; import ConfirmModal from '@components/ConfirmModal'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; import ScreenWrapper from '@components/ScreenWrapper'; import SelectionList from '@components/SelectionList'; +import ListItemRightElementWithArrow from '@components/SelectionList/ListItemRightElementWithArrow'; import TableListItem from '@components/SelectionList/TableListItem'; import type {ListItem} from '@components/SelectionList/types'; import Text from '@components/Text'; @@ -98,24 +98,12 @@ function WorkspaceTagsPage({policyTags, route}: WorkspaceTagsPageProps) { errors: tag.errors ?? undefined, enabled: tag.enabled, isDisabled, - rightElement: ( - - - {tag.enabled ? translate('workspace.common.enabled') : translate('workspace.common.disabled')} - - - - - - ), + rightElement: , }; }), ) .flat(), - [policyTagLists, selectedTags, styles.alignSelfCenter, styles.flexRow, styles.label, styles.p1, styles.pl2, styles.textSupporting, theme.icon, translate], + [policyTagLists, selectedTags, translate], ); const tagListKeyedByName = tagList.reduce>((acc, tag) => { diff --git a/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx index 8ce33ec783c0..603dd1f0b654 100644 --- a/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx +++ b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx @@ -7,11 +7,11 @@ import ButtonWithDropdownMenu from '@components/ButtonWithDropdownMenu'; import type {DropdownOption, WorkspaceTaxRatesBulkActionType} from '@components/ButtonWithDropdownMenu/types'; import ConfirmModal from '@components/ConfirmModal'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; import ScreenWrapper from '@components/ScreenWrapper'; import SelectionList from '@components/SelectionList'; +import ListItemRightElementWithArrow from '@components/SelectionList/ListItemRightElementWithArrow'; import TableListItem from '@components/SelectionList/TableListItem'; import type {ListItem} from '@components/SelectionList/types'; import Text from '@components/Text'; @@ -95,20 +95,10 @@ function WorkspaceTaxesPage({ isDisabled: value.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, pendingAction: value.pendingAction ?? (Object.keys(value.pendingFields ?? {}).length > 0 ? CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE : null), errors: value.errors ?? ErrorUtils.getLatestErrorFieldForAnyField(value), - rightElement: ( - - {value.isDisabled ? translate('workspace.common.disabled') : translate('workspace.common.enabled')} - - - - - ), + rightElement: , })) .sort((a, b) => (a.text ?? a.keyForList ?? '').localeCompare(b.text ?? b.keyForList ?? '')); - }, [policy, textForDefault, selectedTaxesIDs, styles.flexRow, styles.disabledText, styles.alignSelfCenter, styles.p1, styles.pl2, translate, theme.icon]); + }, [policy, textForDefault, selectedTaxesIDs, translate]); const isLoading = !isOffline && taxesList === undefined; From ca03fd1956ba9c941d08b3e936aa030925177451 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Thu, 4 Apr 2024 10:16:49 +0100 Subject: [PATCH 5/5] Address PR feedback --- ...ElementWithArrow.tsx => RightElementEnabledStatus.tsx} | 8 ++++---- .../workspace/categories/WorkspaceCategoriesPage.tsx | 4 ++-- .../workspace/distanceRates/PolicyDistanceRatesPage.tsx | 4 ++-- src/pages/workspace/tags/WorkspaceTagsPage.tsx | 6 +++--- src/pages/workspace/taxes/WorkspaceTaxesPage.tsx | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) rename src/components/SelectionList/{ListItemRightElementWithArrow.tsx => RightElementEnabledStatus.tsx} (79%) diff --git a/src/components/SelectionList/ListItemRightElementWithArrow.tsx b/src/components/SelectionList/RightElementEnabledStatus.tsx similarity index 79% rename from src/components/SelectionList/ListItemRightElementWithArrow.tsx rename to src/components/SelectionList/RightElementEnabledStatus.tsx index f112d97af2ee..50850a8c4e43 100644 --- a/src/components/SelectionList/ListItemRightElementWithArrow.tsx +++ b/src/components/SelectionList/RightElementEnabledStatus.tsx @@ -7,11 +7,11 @@ import useLocalize from '@hooks/useLocalize'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; -type ListItemRightElementWithArrowProps = { +type RightElementEnabledStatusProps = { enabled?: boolean; }; -function ListItemRightElementWithArrow({enabled}: ListItemRightElementWithArrowProps) { +function RightElementEnabledStatus({enabled}: RightElementEnabledStatusProps) { const styles = useThemeStyles(); const theme = useTheme(); const {translate} = useLocalize(); @@ -31,6 +31,6 @@ function ListItemRightElementWithArrow({enabled}: ListItemRightElementWithArrowP ); } -ListItemRightElementWithArrow.displayName = 'ListItemRightElementWithArrow'; +RightElementEnabledStatus.displayName = 'RightElementEnabledStatus'; -export default ListItemRightElementWithArrow; +export default RightElementEnabledStatus; diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index 4e2b91b63953..a3a0da328a09 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -13,7 +13,7 @@ import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; import ScreenWrapper from '@components/ScreenWrapper'; import SelectionList from '@components/SelectionList'; -import ListItemRightElementWithArrow from '@components/SelectionList/ListItemRightElementWithArrow'; +import RightElementEnabledStatus from '@components/SelectionList/RightElementEnabledStatus'; import TableListItem from '@components/SelectionList/TableListItem'; import type {ListItem} from '@components/SelectionList/types'; import Text from '@components/Text'; @@ -88,7 +88,7 @@ function WorkspaceCategoriesPage({policy, policyCategories, route}: WorkspaceCat isDisabled, pendingAction: value.pendingAction, errors: value.errors ?? undefined, - rightElement: , + rightElement: , }; }), [policyCategories, selectedCategories], diff --git a/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx b/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx index b870b91e44da..b3ddaf43a618 100644 --- a/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx +++ b/src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx @@ -12,7 +12,7 @@ import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; import ScreenWrapper from '@components/ScreenWrapper'; import SelectionList from '@components/SelectionList'; -import ListItemRightElementWithArrow from '@components/SelectionList/ListItemRightElementWithArrow'; +import RightElementEnabledStatus from '@components/SelectionList/RightElementEnabledStatus'; import TableListItem from '@components/SelectionList/TableListItem'; import type {ListItem} from '@components/SelectionList/types'; import Text from '@components/Text'; @@ -104,7 +104,7 @@ function PolicyDistanceRatesPage({policy, route}: PolicyDistanceRatesPageProps) isDisabled: value.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, pendingAction: value.pendingAction ?? value.pendingFields?.rate ?? value.pendingFields?.enabled ?? value.pendingFields?.currency, errors: value.errors ?? undefined, - rightElement: , + rightElement: , })), [customUnit?.attributes?.unit, customUnitRates, selectedDistanceRates, translate], ); diff --git a/src/pages/workspace/tags/WorkspaceTagsPage.tsx b/src/pages/workspace/tags/WorkspaceTagsPage.tsx index 1b82786a291d..cd6b3bcc1b66 100644 --- a/src/pages/workspace/tags/WorkspaceTagsPage.tsx +++ b/src/pages/workspace/tags/WorkspaceTagsPage.tsx @@ -14,7 +14,7 @@ import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; import ScreenWrapper from '@components/ScreenWrapper'; import SelectionList from '@components/SelectionList'; -import ListItemRightElementWithArrow from '@components/SelectionList/ListItemRightElementWithArrow'; +import RightElementEnabledStatus from '@components/SelectionList/RightElementEnabledStatus'; import TableListItem from '@components/SelectionList/TableListItem'; import type {ListItem} from '@components/SelectionList/types'; import Text from '@components/Text'; @@ -98,12 +98,12 @@ function WorkspaceTagsPage({policyTags, route}: WorkspaceTagsPageProps) { errors: tag.errors ?? undefined, enabled: tag.enabled, isDisabled, - rightElement: , + rightElement: , }; }), ) .flat(), - [policyTagLists, selectedTags, translate], + [policyTagLists, selectedTags], ); const tagListKeyedByName = tagList.reduce>((acc, tag) => { diff --git a/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx index 603dd1f0b654..bb94dfbc1e19 100644 --- a/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx +++ b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx @@ -11,7 +11,7 @@ import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; import ScreenWrapper from '@components/ScreenWrapper'; import SelectionList from '@components/SelectionList'; -import ListItemRightElementWithArrow from '@components/SelectionList/ListItemRightElementWithArrow'; +import RightElementEnabledStatus from '@components/SelectionList/RightElementEnabledStatus'; import TableListItem from '@components/SelectionList/TableListItem'; import type {ListItem} from '@components/SelectionList/types'; import Text from '@components/Text'; @@ -95,10 +95,10 @@ function WorkspaceTaxesPage({ isDisabled: value.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, pendingAction: value.pendingAction ?? (Object.keys(value.pendingFields ?? {}).length > 0 ? CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE : null), errors: value.errors ?? ErrorUtils.getLatestErrorFieldForAnyField(value), - rightElement: , + rightElement: , })) .sort((a, b) => (a.text ?? a.keyForList ?? '').localeCompare(b.text ?? b.keyForList ?? '')); - }, [policy, textForDefault, selectedTaxesIDs, translate]); + }, [policy, textForDefault, selectedTaxesIDs]); const isLoading = !isOffline && taxesList === undefined;