From 01159ea4d4a51cf6710f2d349b763128ed19e772 Mon Sep 17 00:00:00 2001 From: FitseTLT Date: Wed, 11 Dec 2024 01:09:32 +0300 Subject: [PATCH 1/3] made billable text color consistent --- .../MoneyRequestConfirmationListFooter.tsx | 1 - .../ReportActionItem/MoneyRequestView.tsx | 2 +- .../WorkspaceCategoriesSettingsPage.tsx | 93 ++++++++++--------- 3 files changed, 49 insertions(+), 47 deletions(-) diff --git a/src/components/MoneyRequestConfirmationListFooter.tsx b/src/components/MoneyRequestConfirmationListFooter.tsx index 01756e11aadf..5c846762e7f3 100644 --- a/src/components/MoneyRequestConfirmationListFooter.tsx +++ b/src/components/MoneyRequestConfirmationListFooter.tsx @@ -529,7 +529,6 @@ function MoneyRequestConfirmationListFooter({ onToggle={(isOn) => onToggleBillable?.(isOn)} isActive={iouIsBillable} disabled={isReadOnly} - titleStyle={!iouIsBillable && {color: theme.textSupporting}} wrapperStyle={styles.flex1} /> diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx index ca50e93e536f..f87237524284 100644 --- a/src/components/ReportActionItem/MoneyRequestView.tsx +++ b/src/components/ReportActionItem/MoneyRequestView.tsx @@ -730,7 +730,7 @@ function MoneyRequestView({report, shouldShowAnimatedBackground, readonly = fals {shouldShowBillable && ( - {translate('common.billable')} + {translate('common.billable')} {!!getErrorForField('billable') && ( Navigation.goBack(isQuickSettingsFlow ? ROUTES.SETTINGS_CATEGORIES_ROOT.getRoute(policyID, backTo) : undefined)} /> - Policy.clearPolicyErrorField(policy?.id ?? '-1', 'requiresCategory')} - shouldPlaceSubtitleBelowSwitch - /> - - - {!!currentPolicy && (sections.at(0)?.data?.length ?? 0) > 0 && ( - - {translate('workspace.categories.defaultSpendCategories')} - {translate('workspace.categories.spendCategoriesDescription')} - - } - sections={sections} - ListItem={SpendCategorySelectorListItem} - onSelectRow={(item) => { - if (!item.groupID || !item.categoryID) { - return; + + Policy.clearPolicyErrorField(policy?.id ?? '-1', 'requiresCategory')} + shouldPlaceSubtitleBelowSwitch + /> + + + {!!currentPolicy && (sections.at(0)?.data?.length ?? 0) > 0 && ( + + {translate('workspace.categories.defaultSpendCategories')} + {translate('workspace.categories.spendCategoriesDescription')} + } - setIsSelectorModalVisible(true); - setCategoryID(item.categoryID); - setGroupID(item.groupID); - }} - /> - )} - {!!categoryID && !!groupID && ( - setIsSelectorModalVisible(false)} - onCategorySelected={setNewCategory} - label={groupID[0].toUpperCase() + groupID.slice(1)} - /> - )} - + sections={sections} + ListItem={SpendCategorySelectorListItem} + onSelectRow={(item) => { + if (!item.groupID || !item.categoryID) { + return; + } + setIsSelectorModalVisible(true); + setCategoryID(item.categoryID); + setGroupID(item.groupID); + }} + /> + )} + + + {!!categoryID && !!groupID && ( + setIsSelectorModalVisible(false)} + onCategorySelected={setNewCategory} + label={groupID[0].toUpperCase() + groupID.slice(1)} + /> + )} ); From dd1060b82f18e8451fb4c5988d5784b7156bee15 Mon Sep 17 00:00:00 2001 From: FitseTLT Date: Wed, 11 Dec 2024 18:32:57 +0300 Subject: [PATCH 2/3] minor fix --- src/components/MoneyRequestConfirmationListFooter.tsx | 1 - src/components/ReportActionItem/MoneyRequestView.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/src/components/MoneyRequestConfirmationListFooter.tsx b/src/components/MoneyRequestConfirmationListFooter.tsx index 5c846762e7f3..5bcc90621ff8 100644 --- a/src/components/MoneyRequestConfirmationListFooter.tsx +++ b/src/components/MoneyRequestConfirmationListFooter.tsx @@ -216,7 +216,6 @@ function MoneyRequestConfirmationListFooter({ unit, }: MoneyRequestConfirmationListFooterProps) { const styles = useThemeStyles(); - const theme = useTheme(); const {translate, toLocaleDigit} = useLocalize(); const {isOffline} = useNetwork(); const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY); diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx index f87237524284..34c2ab7b615e 100644 --- a/src/components/ReportActionItem/MoneyRequestView.tsx +++ b/src/components/ReportActionItem/MoneyRequestView.tsx @@ -79,7 +79,6 @@ const getTransactionID = (report: OnyxEntry, parentReportActio }; function MoneyRequestView({report, shouldShowAnimatedBackground, readonly = false, updatedTransaction, isFromReviewDuplicates = false}: MoneyRequestViewProps) { - const theme = useTheme(); const styles = useThemeStyles(); const session = useSession(); const {isOffline} = useNetwork(); From 766f66409ac4fb283045eec33d9e4d1c8111ed23 Mon Sep 17 00:00:00 2001 From: FitseTLT Date: Wed, 11 Dec 2024 18:36:45 +0300 Subject: [PATCH 3/3] minor fix --- src/components/MoneyRequestConfirmationListFooter.tsx | 1 - src/components/ReportActionItem/MoneyRequestView.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/src/components/MoneyRequestConfirmationListFooter.tsx b/src/components/MoneyRequestConfirmationListFooter.tsx index 5bcc90621ff8..6c5cc9ae10cc 100644 --- a/src/components/MoneyRequestConfirmationListFooter.tsx +++ b/src/components/MoneyRequestConfirmationListFooter.tsx @@ -8,7 +8,6 @@ import {useOnyx} from 'react-native-onyx'; import type {ValueOf} from 'type-fest'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; -import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import * as CurrencyUtils from '@libs/CurrencyUtils'; import DistanceRequestUtils from '@libs/DistanceRequestUtils'; diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx index 34c2ab7b615e..d300bb3bbdc7 100644 --- a/src/components/ReportActionItem/MoneyRequestView.tsx +++ b/src/components/ReportActionItem/MoneyRequestView.tsx @@ -15,7 +15,6 @@ import ViolationMessages from '@components/ViolationMessages'; import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; -import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import useViolations from '@hooks/useViolations'; import type {ViolationField} from '@hooks/useViolations';