diff --git a/src/components/ReportActionItem/ActionableItemButtons.tsx b/src/components/ReportActionItem/ActionableItemButtons.tsx index dd7d212656b8..3db4d53fa9cb 100644 --- a/src/components/ReportActionItem/ActionableItemButtons.tsx +++ b/src/components/ReportActionItem/ActionableItemButtons.tsx @@ -1,11 +1,14 @@ -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; +import type {ButtonTextProps} from '@components/ButtonComposed/primitives/ButtonText'; +import type {ButtonStyleProps} from '@components/ButtonComposed/types'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; +import CONST from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; -import type {StyleProp, TextStyle, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; import React from 'react'; import {View} from 'react-native'; @@ -14,19 +17,18 @@ type ActionableItem = { isPrimary?: boolean; key: string; onPress: () => void; - text: string; - shouldUseLocalization?: boolean; -}; +} & ({translationKey: TranslationPaths; text?: never} | {text: string; translationKey?: never}); type ActionableItemButtonsProps = { items: ActionableItem[]; layout?: 'horizontal' | 'vertical'; - shouldUseLocalization?: boolean; - primaryTextNumberOfLines?: number; - styles?: { - text?: StyleProp; - button?: StyleProp; - }; + + /** Props forwarded to the `Button` rendered for each item */ + buttonProps?: Pick; + + /** Props forwarded to the `Button.Text` rendered for each item */ + textProps?: Pick; + wrapperStyle?: StyleProp; }; @@ -40,13 +42,12 @@ function ActionableItemButtons(props: ActionableItemButtonsProps) { ))} ); diff --git a/src/components/ReportActionItem/IssueCardMessage.tsx b/src/components/ReportActionItem/IssueCardMessage.tsx index 6595a73d2296..4951d6c5d0b2 100644 --- a/src/components/ReportActionItem/IssueCardMessage.tsx +++ b/src/components/ReportActionItem/IssueCardMessage.tsx @@ -1,4 +1,4 @@ -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; import {useSession} from '@components/OnyxListItemProvider'; import RenderHTML from '@components/RenderHTML'; @@ -15,6 +15,7 @@ import type {ReportsSplitNavigatorParamList} from '@libs/Navigation/types'; import {isPolicyAdmin} from '@libs/PolicyUtils'; import {getCardIssuedMessage, getOriginalMessage, shouldShowActivateCard, shouldShowAddMissingDetails} from '@libs/ReportActionsUtils'; +import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES, {DYNAMIC_ROUTES} from '@src/ROUTES'; import type SCREENS from '@src/SCREENS'; @@ -63,10 +64,11 @@ function IssueCardMessage({action, policyID}: IssueCardMessageProps) { onPress={() => { Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.MISSING_PERSONAL_DETAILS.getRoute(String(expensifyCard.cardID)))); }} - success + variant={CONST.BUTTON_VARIANT.SUCCESS} style={[styles.alignSelfStart, styles.mt3]} - text={translate('workspace.expensifyCard.addShippingDetails')} - /> + > + {translate('workspace.expensifyCard.addShippingDetails')} + )} {shouldShowActivateButton && ( )} ); diff --git a/src/components/ReportActionItem/TransactionPreview/TransactionPreviewContent.tsx b/src/components/ReportActionItem/TransactionPreview/TransactionPreviewContent.tsx index 078404fed1c8..b541fd30a456 100644 --- a/src/components/ReportActionItem/TransactionPreview/TransactionPreviewContent.tsx +++ b/src/components/ReportActionItem/TransactionPreview/TransactionPreviewContent.tsx @@ -1,4 +1,4 @@ -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; import Icon from '@components/Icon'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; import ReportActionAvatars from '@components/ReportActionAvatars'; @@ -453,11 +453,12 @@ function TransactionPreviewContent({ )} {isReviewDuplicateTransactionPage && !isIOUSettled && !isApproved && !isCardTransaction && areThereDuplicates && ( )} diff --git a/src/components/Search/FilterComponents/AdvancedFilters/AmountFilterContent.tsx b/src/components/Search/FilterComponents/AdvancedFilters/AmountFilterContent.tsx index 058b7b8ee6a6..8e555ed3415d 100644 --- a/src/components/Search/FilterComponents/AdvancedFilters/AmountFilterContent.tsx +++ b/src/components/Search/FilterComponents/AdvancedFilters/AmountFilterContent.tsx @@ -1,5 +1,5 @@ import AmountWithoutCurrencyInput from '@components/AmountWithoutCurrencyInput'; -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; import ScrollView from '@components/ScrollView'; import type {SearchAmountFilterKeys, SearchAmountValues} from '@components/Search/types'; import SingleSelectListItem from '@components/SelectionList/ListItem/SingleSelectListItem'; @@ -246,12 +246,13 @@ function AmountFilterContent({baseFilterKey, value, autoFocus, largeButton, styl ); } diff --git a/src/components/Search/FilterComponents/AdvancedFilters/DateFilterContent.tsx b/src/components/Search/FilterComponents/AdvancedFilters/DateFilterContent.tsx index 7addd6ecf2d6..b98c43b9eb88 100644 --- a/src/components/Search/FilterComponents/AdvancedFilters/DateFilterContent.tsx +++ b/src/components/Search/FilterComponents/AdvancedFilters/DateFilterContent.tsx @@ -1,4 +1,4 @@ -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import DateFilterBase from '@components/Search/FilterComponents/DateFilterBase'; import type {DateFilterBaseHandle} from '@components/Search/FilterComponents/DateFilterBase'; @@ -12,7 +12,10 @@ import type {SearchDateValues} from '@libs/SearchQueryUtils'; import {getDatePresets} from '@libs/SearchUIUtils'; import type {SearchDateModifier} from '@libs/SearchUIUtils'; +import CONST from '@src/CONST'; + import type {StyleProp, ViewStyle} from 'react-native'; +import type {ValueOf} from 'type-fest'; import React, {useRef} from 'react'; @@ -21,13 +24,13 @@ type DateFilterContentProps = { value: SearchDateValues; selectedDateModifier: SearchDateModifier | null; hasFeed: boolean; - largeButton?: boolean; + size?: Exclude, typeof CONST.BUTTON_SIZE.SMALL>; style?: StyleProp; onDateModifierSelected: (modifier: SearchDateModifier | null) => void; onChange: (values: SearchDateValues) => void; }; -function DateFilterContent({baseFilterKey, value, selectedDateModifier, hasFeed, largeButton, style, onDateModifierSelected, onChange}: DateFilterContentProps) { +function DateFilterContent({baseFilterKey, value, selectedDateModifier, hasFeed, size, style, onDateModifierSelected, onChange}: DateFilterContentProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); const dateFilterRef = useRef(null); @@ -61,12 +64,13 @@ function DateFilterContent({baseFilterKey, value, selectedDateModifier, hasFeed, {!!selectedDateModifier && ( )} ); diff --git a/src/components/Search/FilterComponents/AdvancedFilters/ReportFieldFilterContent.tsx b/src/components/Search/FilterComponents/AdvancedFilters/ReportFieldFilterContent.tsx index 92508406ae89..54ee83e84b66 100644 --- a/src/components/Search/FilterComponents/AdvancedFilters/ReportFieldFilterContent.tsx +++ b/src/components/Search/FilterComponents/AdvancedFilters/ReportFieldFilterContent.tsx @@ -1,27 +1,29 @@ -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; import ReportFieldBase from '@components/Search/FilterComponents/ReportField'; import type {ReportFieldHandle} from '@components/Search/FilterComponents/ReportField'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; +import CONST from '@src/CONST'; import type {SearchAdvancedFiltersForm} from '@src/types/form'; import type {PolicyReportField} from '@src/types/onyx'; import type {StyleProp, ViewStyle} from 'react-native'; +import type {ValueOf} from 'type-fest'; import React, {useRef, useState} from 'react'; type ReportFieldFilterContentProps = { values: Partial | undefined; selectedField: PolicyReportField | null; - largeButton?: boolean; + size?: Exclude, typeof CONST.BUTTON_SIZE.SMALL>; style?: StyleProp; onFieldSelected: (field: PolicyReportField | null) => void; onChange: (values: Partial) => void; }; -function ReportFieldFilterContent({values, selectedField, largeButton, style, onFieldSelected, onChange}: ReportFieldFilterContentProps) { +function ReportFieldFilterContent({values, selectedField, size, style, onFieldSelected, onChange}: ReportFieldFilterContentProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); const reportFieldRef = useRef(null); @@ -42,10 +44,8 @@ function ReportFieldFilterContent({values, selectedField, largeButton, style, on {!!selectedField && ( )} ); diff --git a/src/components/Search/FilterComponents/AdvancedFilters/TextInputFilterContent.tsx b/src/components/Search/FilterComponents/AdvancedFilters/TextInputFilterContent.tsx index 7963769a44ff..bf92c39e5811 100644 --- a/src/components/Search/FilterComponents/AdvancedFilters/TextInputFilterContent.tsx +++ b/src/components/Search/FilterComponents/AdvancedFilters/TextInputFilterContent.tsx @@ -1,4 +1,4 @@ -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; import NegatableFilter from '@components/Search/FilterComponents/NegatableFilter'; import useTextFilterValidation from '@components/Search/hooks/useTextFilterValidation'; import type {ReportFieldTextKey, SearchTextFilterKeys} from '@components/Search/types'; @@ -14,6 +14,7 @@ import {FILTER_VIEW_MAP} from '@libs/SearchUIUtils'; import CONST from '@src/CONST'; import type {TextInput as RNTextInput, StyleProp, ViewStyle} from 'react-native'; +import type {ValueOf} from 'type-fest'; import React, {useState} from 'react'; import {View} from 'react-native'; @@ -22,7 +23,7 @@ type TextInputFilterContentProps = { baseFilterKey: Exclude; value: string | undefined; isNegated: boolean; - largeButton?: boolean; + size?: Exclude, typeof CONST.BUTTON_SIZE.SMALL>; autoFocus?: boolean; style?: StyleProp; onChange: (value: string | undefined, isNegated: boolean) => void; @@ -32,7 +33,7 @@ function isTextInput(element: BaseTextInputRef | RNTextInput | null): element is return !!element && 'isFocused' in element; } -function TextInputFilterContent({baseFilterKey, value: initialValue, isNegated: initialIsNegated, autoFocus, largeButton, style, onChange}: TextInputFilterContentProps) { +function TextInputFilterContent({baseFilterKey, value: initialValue, isNegated: initialIsNegated, autoFocus, size, style, onChange}: TextInputFilterContentProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); const [value, setValue] = useState(initialValue); @@ -68,17 +69,18 @@ function TextInputFilterContent({baseFilterKey, value: initialValue, isNegated: ); } diff --git a/src/components/Search/FilterComponents/DateFilterBase.tsx b/src/components/Search/FilterComponents/DateFilterBase.tsx index 52dcb53f7505..0cb5d5c4f355 100644 --- a/src/components/Search/FilterComponents/DateFilterBase.tsx +++ b/src/components/Search/FilterComponents/DateFilterBase.tsx @@ -1,4 +1,4 @@ -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; import FormAlertWithSubmitButton from '@components/FormAlertWithSubmitButton'; import FormHelpMessage from '@components/FormHelpMessage'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; @@ -261,11 +261,12 @@ function DateFilterBase({ <> {!selectedDateModifier && ( )} {!!onReset && ( )} ); } diff --git a/src/components/Search/SearchFilterPageFooterButtons.tsx b/src/components/Search/SearchFilterPageFooterButtons.tsx index ba656925f484..4df6e1531af6 100644 --- a/src/components/Search/SearchFilterPageFooterButtons.tsx +++ b/src/components/Search/SearchFilterPageFooterButtons.tsx @@ -1,4 +1,4 @@ -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; @@ -24,22 +24,24 @@ function SearchFilterPageFooterButtons({resetChanges, applyChanges}: SearchFilte {!!resetChanges && ( )} ); } diff --git a/src/components/Search/SearchList/ListItem/ActionCell/DeferredActionCell.tsx b/src/components/Search/SearchList/ListItem/ActionCell/DeferredActionCell.tsx index 825edbcd58eb..1f8db06fd0b8 100644 --- a/src/components/Search/SearchList/ListItem/ActionCell/DeferredActionCell.tsx +++ b/src/components/Search/SearchList/ListItem/ActionCell/DeferredActionCell.tsx @@ -1,4 +1,4 @@ -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; @@ -32,14 +32,14 @@ function DeferredActionCell(actionCellProps: DeferredActionCellProps) { return ( ); } diff --git a/src/components/Search/SearchList/ListItem/ActionCell/index.tsx b/src/components/Search/SearchList/ListItem/ActionCell/index.tsx index cb243f936a07..1a23a0264e7d 100644 --- a/src/components/Search/SearchList/ListItem/ActionCell/index.tsx +++ b/src/components/Search/SearchList/ListItem/ActionCell/index.tsx @@ -1,4 +1,5 @@ -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; +import LinkButton from '@components/ButtonComposed/composed/LinkButton'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; @@ -32,7 +33,6 @@ type ActionCellProps = { reportID?: string; hash?: number; amount?: number; - extraSmall?: boolean; shouldDisablePointerEvents?: boolean; chatReport?: OnyxEntry; }; @@ -47,7 +47,6 @@ function ActionCell({ reportID = '', hash, amount, - extraSmall = false, shouldDisablePointerEvents, chatReport, }: ActionCellProps) { @@ -62,24 +61,23 @@ function ActionCell({ if (shouldUseViewAction || (isChildListItem && action !== CONST.SEARCH.ACTION_TYPES.UNDELETE)) { const text = translate(actionTranslationsMap[CONST.SEARCH.ACTION_TYPES.VIEW]); - const buttonInnerStyles = isSelected ? styles.buttonDefaultSelected : {}; + const buttonInnerStyles = isSelected && styles.buttonDefaultSelected; + const ViewButton = isChildListItem ? LinkButton : Button; return ( - ); } diff --git a/src/components/Search/SearchList/ListItem/TaskListItemRow.tsx b/src/components/Search/SearchList/ListItem/TaskListItemRow.tsx index 898edbba66bc..c5a29cc4fce0 100644 --- a/src/components/Search/SearchList/ListItem/TaskListItemRow.tsx +++ b/src/components/Search/SearchList/ListItem/TaskListItemRow.tsx @@ -1,6 +1,6 @@ import Avatar from '@components/Avatar'; import Badge from '@components/Badge'; -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; import Icon from '@components/Icon'; import {useSession} from '@components/OnyxListItemProvider'; import TextWithTooltip from '@components/TextWithTooltip'; @@ -114,15 +114,16 @@ function ActionCell({taskItem, isLargeScreenWidth}: TaskCellProps) { return ( ); } diff --git a/src/components/Search/SearchList/ListItem/TransactionGroupListExpanded.tsx b/src/components/Search/SearchList/ListItem/TransactionGroupListExpanded.tsx index 47746cb3dc2e..69b8a406b3fe 100644 --- a/src/components/Search/SearchList/ListItem/TransactionGroupListExpanded.tsx +++ b/src/components/Search/SearchList/ListItem/TransactionGroupListExpanded.tsx @@ -1,5 +1,5 @@ import ActivityIndicator from '@components/ActivityIndicator'; -import Button from '@components/Button'; +import LinkButton from '@components/ButtonComposed/composed/LinkButton'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; import {PressableWithFeedback} from '@components/Pressable'; import ScrollView from '@components/ScrollView'; @@ -390,16 +390,14 @@ function TransactionGroupListExpandedImpl({ })} {shouldDisplayShowMoreButton && !shouldDisplayLoadingIndicator && ( - {restrictionTypeHelperText} diff --git a/src/components/SpendRules/SpendRuleRestrictionTypeToggleRevamp.tsx b/src/components/SpendRules/SpendRuleRestrictionTypeToggleRevamp.tsx index 6d8f25be1584..92810fb3dc9b 100644 --- a/src/components/SpendRules/SpendRuleRestrictionTypeToggleRevamp.tsx +++ b/src/components/SpendRules/SpendRuleRestrictionTypeToggleRevamp.tsx @@ -1,4 +1,4 @@ -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; import Icon from '@components/Icon'; import Text from '@components/Text'; @@ -56,37 +56,37 @@ function SpendRuleRestrictionTypeToggleRevamp({restrictionAction, onSelect, icon {translate('workspace.rules.spendRules.restrictMerchants')} {restrictionTypeHelperText} diff --git a/src/pages/Search/SearchAdvancedFiltersContentPage/DateFilterContentPageWrapper.tsx b/src/pages/Search/SearchAdvancedFiltersContentPage/DateFilterContentPageWrapper.tsx index 02cfbce27892..a2d58ff17f39 100644 --- a/src/pages/Search/SearchAdvancedFiltersContentPage/DateFilterContentPageWrapper.tsx +++ b/src/pages/Search/SearchAdvancedFiltersContentPage/DateFilterContentPageWrapper.tsx @@ -1,4 +1,4 @@ -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; import DateFilterContent from '@components/Search/FilterComponents/AdvancedFilters/DateFilterContent'; import type {DateFilterContentWrapperProps} from '@components/Search/FilterComponents/AdvancedFilters/SearchAdvancedFiltersContent'; @@ -7,6 +7,8 @@ import useThemeStyles from '@hooks/useThemeStyles'; import type {SearchDateModifier} from '@libs/SearchUIUtils'; +import CONST from '@src/CONST'; + import React, {useState} from 'react'; import {View} from 'react-native'; @@ -23,7 +25,7 @@ function DateFilterContentPageWrapper({baseFilterKey, value: initialValue, hasFe value={value} selectedDateModifier={selectedDateModifier} hasFeed={hasFeed} - largeButton + size={CONST.BUTTON_SIZE.LARGE} style={[styles.flex1]} onDateModifierSelected={setSelectedDateModifier} onChange={setValue} @@ -31,12 +33,13 @@ function DateFilterContentPageWrapper({baseFilterKey, value: initialValue, hasFe {!selectedDateModifier && ( )} ); diff --git a/src/pages/Search/SearchAdvancedFiltersContentPage/ReportFieldFilterContentPageWrapper.tsx b/src/pages/Search/SearchAdvancedFiltersContentPage/ReportFieldFilterContentPageWrapper.tsx index a8a7f838456b..7a67f2902cac 100644 --- a/src/pages/Search/SearchAdvancedFiltersContentPage/ReportFieldFilterContentPageWrapper.tsx +++ b/src/pages/Search/SearchAdvancedFiltersContentPage/ReportFieldFilterContentPageWrapper.tsx @@ -1,10 +1,11 @@ -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; import ReportFieldFilterContent from '@components/Search/FilterComponents/AdvancedFilters/ReportFieldFilterContent'; import type {ReportFieldFilterContentWrapperProps} from '@components/Search/FilterComponents/AdvancedFilters/SearchAdvancedFiltersContent'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; +import CONST from '@src/CONST'; import type {PolicyReportField} from '@src/types/onyx'; import React, {useState} from 'react'; @@ -21,17 +22,15 @@ function ReportFieldFilterContentPageWrapper({values: initialValues, onChange}: setValues((prevValues) => ({...prevValues, ...newValues}))} /> {!selectedField && ( )} ); diff --git a/src/pages/Search/SearchAdvancedFiltersContentPage/TextInputFilterContentPageWrapper.tsx b/src/pages/Search/SearchAdvancedFiltersContentPage/TextInputFilterContentPageWrapper.tsx index 6681735ff4b3..d2b9a605ab27 100644 --- a/src/pages/Search/SearchAdvancedFiltersContentPage/TextInputFilterContentPageWrapper.tsx +++ b/src/pages/Search/SearchAdvancedFiltersContentPage/TextInputFilterContentPageWrapper.tsx @@ -1,6 +1,8 @@ import type {TextInputFilterContentWrapperProps} from '@components/Search/FilterComponents/AdvancedFilters/SearchAdvancedFiltersContent'; import TextInputFilterContent from '@components/Search/FilterComponents/AdvancedFilters/TextInputFilterContent'; +import CONST from '@src/CONST'; + import React from 'react'; function TextInputFilterContentPageWrapper({baseFilterKey, value, isNegated, onChange}: TextInputFilterContentWrapperProps) { @@ -10,7 +12,7 @@ function TextInputFilterContentPageWrapper({baseFilterKey, value, isNegated, onC value={value} isNegated={isNegated} autoFocus - largeButton + size={CONST.BUTTON_SIZE.LARGE} onChange={onChange} /> ); diff --git a/src/pages/Search/SearchAdvancedFiltersPage/SearchAdvancedFiltersBase.tsx b/src/pages/Search/SearchAdvancedFiltersPage/SearchAdvancedFiltersBase.tsx index 5eea2db68804..6c3c67642277 100644 --- a/src/pages/Search/SearchAdvancedFiltersPage/SearchAdvancedFiltersBase.tsx +++ b/src/pages/Search/SearchAdvancedFiltersPage/SearchAdvancedFiltersBase.tsx @@ -1,4 +1,4 @@ -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import ScreenWrapper from '@components/ScreenWrapper'; import FilterList from '@components/Search/FilterComponents/AdvancedFilters/FilterList'; @@ -39,18 +39,20 @@ function SearchAdvancedFiltersBase() { {shouldShowResetFilters && ( )} ); } diff --git a/src/pages/Search/SearchEditMultiple/SearchEditMultiplePage.tsx b/src/pages/Search/SearchEditMultiple/SearchEditMultiplePage.tsx index 1eadb5b76f42..b7d2f30b12ce 100644 --- a/src/pages/Search/SearchEditMultiple/SearchEditMultiplePage.tsx +++ b/src/pages/Search/SearchEditMultiple/SearchEditMultiplePage.tsx @@ -1,4 +1,4 @@ -import Button from '@components/Button'; +import Button from '@components/ButtonComposed'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import ScreenWrapper from '@components/ScreenWrapper'; @@ -348,14 +348,15 @@ function SearchEditMultiplePage() { ))} ); diff --git a/src/pages/inbox/report/actionContents/ChatActionableButtons.tsx b/src/pages/inbox/report/actionContents/ChatActionableButtons.tsx index faf8e24a7c7f..4e28a7f630ca 100644 --- a/src/pages/inbox/report/actionContents/ChatActionableButtons.tsx +++ b/src/pages/inbox/report/actionContents/ChatActionableButtons.tsx @@ -90,7 +90,7 @@ function ChatActionableButtons({action, originalReportID, reportID, hasPendingFo if (isActionableAddPaymentCard(action) && !doesUserHavePaymentCardAdded(userBillingFundID) && shouldRenderAddPaymentCard()) { return [ { - text: 'subscription.cardSection.addCardButton', + translationKey: 'subscription.cardSection.addCardButton', key: `${action.reportActionID}-actionableAddPaymentCard-submit`, onPress: () => { Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD); @@ -169,7 +169,6 @@ function ChatActionableButtons({action, originalReportID, reportID, hasPendingFo if (followups && followups.length > 0) { return followups.map((followup) => ({ text: followup.text, - shouldUseLocalization: false, key: `${action.reportActionID}-followup-${followup.text}`, onPress: () => { resolveSuggestedFollowup( @@ -211,8 +210,8 @@ function ChatActionableButtons({action, originalReportID, reportID, hasPendingFo categorize: CONST.IOU.ACTION.CATEGORIZE, share: CONST.IOU.ACTION.SHARE, } as const; - const prepareTrackExpenseButton = (actionKey: keyof typeof TRACK_EXPENSE_ACTIONS, extraParams?: Partial) => ({ - text: `actionableMentionTrackExpense.${actionKey}`, + const prepareTrackExpenseButton = (actionKey: keyof typeof TRACK_EXPENSE_ACTIONS, extraParams?: Partial): ActionableItem => ({ + translationKey: `actionableMentionTrackExpense.${actionKey}`, key: `${action.reportActionID}-actionableMentionTrackExpense-${actionKey}`, onPress: () => { createDraftTransactionAndNavigateToParticipantSelector({ @@ -226,7 +225,7 @@ function ChatActionableButtons({action, originalReportID, reportID, hasPendingFo // On the Submit (submit2026) plan, "Submit it to someone" splits into two destinations: // submit to an individual ("a friend") or route to a submit-enabled workspace ("my employer"). const prepareSubmitDestinationButton = (destination: ValueOf, textKey: 'submitToFriend' | 'submitToEmployer'): ActionableItem => ({ - text: `actionableMentionTrackExpense.${textKey}`, + translationKey: `actionableMentionTrackExpense.${textKey}`, key: `${action.reportActionID}-actionableMentionTrackExpense-${textKey}`, onPress: () => { createDraftTransactionAndNavigateToParticipantSelector({ @@ -256,7 +255,7 @@ function ChatActionableButtons({action, originalReportID, reportID, hasPendingFo options.push(prepareTrackExpenseButton('categorize'), prepareTrackExpenseButton('share')); } options.push({ - text: 'actionableMentionTrackExpense.nothing', + translationKey: 'actionableMentionTrackExpense.nothing', key: `${action.reportActionID}-actionableMentionTrackExpense-nothing`, onPress: () => { dismissTrackExpenseActionableWhisper(actionOwnerReportID, action); @@ -284,13 +283,14 @@ function ChatActionableButtons({action, originalReportID, reportID, hasPendingFo ); } diff --git a/src/pages/inbox/report/actionContents/ConfirmWhisperContent.tsx b/src/pages/inbox/report/actionContents/ConfirmWhisperContent.tsx index 507d2273e600..5581be55b90f 100644 --- a/src/pages/inbox/report/actionContents/ConfirmWhisperContent.tsx +++ b/src/pages/inbox/report/actionContents/ConfirmWhisperContent.tsx @@ -41,7 +41,7 @@ function ConfirmWhisperContent({action, reportID, originalReportID, actionOwnerR const buttons: ActionableItem[] = [ { - text: 'common.buttonConfirm', + translationKey: 'common.buttonConfirm', key: `${action.reportActionID}-actionableReportMentionConfirmWhisper-${CONST.REPORT.ACTIONABLE_MENTION_INVITE_TO_SUBMIT_EXPENSE_CONFIRM_WHISPER.DONE}`, onPress: () => resolveActionableMentionConfirmWhisper(actionOwnerReport, action, CONST.REPORT.ACTIONABLE_MENTION_INVITE_TO_SUBMIT_EXPENSE_CONFIRM_WHISPER.DONE, isOriginalReportArchived), @@ -59,7 +59,6 @@ function ConfirmWhisperContent({action, reportID, originalReportID, actionOwnerR /> diff --git a/src/pages/inbox/report/actionContents/FraudAlertContent.tsx b/src/pages/inbox/report/actionContents/FraudAlertContent.tsx index c02cdf3d7c83..ee4a57815b7b 100644 --- a/src/pages/inbox/report/actionContents/FraudAlertContent.tsx +++ b/src/pages/inbox/report/actionContents/FraudAlertContent.tsx @@ -38,7 +38,7 @@ function FraudAlertContent({action, reportID}: FraudAlertContentProps) { ? [] : [ { - text: 'cardPage.cardFraudAlert.confirmButtonText', + translationKey: 'cardPage.cardFraudAlert.confirmButtonText', key: `${action.reportActionID}-cardFraudAlert-confirm`, onPress: () => { resolveFraudAlert(cardID, false, reportID, reportActionID, possibleFraud); @@ -46,7 +46,7 @@ function FraudAlertContent({action, reportID}: FraudAlertContentProps) { isPrimary: true, }, { - text: 'cardPage.cardFraudAlert.reportFraudButtonText', + translationKey: 'cardPage.cardFraudAlert.reportFraudButtonText', key: `${action.reportActionID}-cardFraudAlert-reportFraud`, onPress: () => { resolveFraudAlert(cardID, true, reportID, reportActionID, possibleFraud); @@ -65,7 +65,6 @@ function FraudAlertContent({action, reportID}: FraudAlertContentProps) { {buttons.length > 0 && ( )} diff --git a/src/pages/inbox/report/actionContents/JoinRequestContent.tsx b/src/pages/inbox/report/actionContents/JoinRequestContent.tsx index 96bc8001d10f..0a2994631411 100644 --- a/src/pages/inbox/report/actionContents/JoinRequestContent.tsx +++ b/src/pages/inbox/report/actionContents/JoinRequestContent.tsx @@ -33,13 +33,13 @@ function JoinRequestContent({action, actionOwnerReportID, policyID}: JoinRequest ? [] : [ { - text: 'actionableMentionJoinWorkspaceOptions.accept', + translationKey: 'actionableMentionJoinWorkspaceOptions.accept', key: `${action.reportActionID}-actionableMentionJoinWorkspace-${CONST.REPORT.ACTIONABLE_MENTION_JOIN_WORKSPACE_RESOLUTION.ACCEPT}`, onPress: () => acceptJoinRequest(actionOwnerReportID, action), isPrimary: true, }, { - text: 'actionableMentionJoinWorkspaceOptions.decline', + translationKey: 'actionableMentionJoinWorkspaceOptions.decline', key: `${action.reportActionID}-actionableMentionJoinWorkspace-${CONST.REPORT.ACTIONABLE_MENTION_JOIN_WORKSPACE_RESOLUTION.DECLINE}`, onPress: () => declineJoinRequest(actionOwnerReportID, action), }, @@ -51,7 +51,6 @@ function JoinRequestContent({action, actionOwnerReportID, policyID}: JoinRequest {buttons.length > 0 && ( )} diff --git a/src/pages/inbox/report/actionContents/MentionWhisperContent.tsx b/src/pages/inbox/report/actionContents/MentionWhisperContent.tsx index 7386382a9466..019b3c11d162 100644 --- a/src/pages/inbox/report/actionContents/MentionWhisperContent.tsx +++ b/src/pages/inbox/report/actionContents/MentionWhisperContent.tsx @@ -58,7 +58,7 @@ function MentionWhisperContent({action, actionOwnerReportStable, parentReport, o const buttons: ActionableItem[] = []; if ((isPolicyAdmin(policy) || isPolicyOwner(policy, currentUserAccountID)) && isReportInPolicy && !isSystemUserMentioned(action) && !hasMentionedPolicyMembers) { buttons.push({ - text: 'actionableMentionWhisperOptions.inviteToSubmitExpense', + translationKey: 'actionableMentionWhisperOptions.inviteToSubmitExpense', key: `${action.reportActionID}-actionableMentionWhisper-${CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE_TO_SUBMIT_EXPENSE}`, onPress: () => resolveActionableMentionWhisper( @@ -72,12 +72,12 @@ function MentionWhisperContent({action, actionOwnerReportStable, parentReport, o } buttons.push( { - text: 'actionableMentionWhisperOptions.inviteToChat', + translationKey: 'actionableMentionWhisperOptions.inviteToChat', key: `${action.reportActionID}-actionableMentionWhisper-${CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE}`, onPress: () => resolveActionableMentionWhisper(actionOwnerReport, action, CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE, isOriginalReportArchived, parentReport), }, { - text: 'actionableMentionWhisperOptions.nothing', + translationKey: 'actionableMentionWhisperOptions.nothing', key: `${action.reportActionID}-actionableMentionWhisper-${CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.NOTHING}`, onPress: () => resolveActionableMentionWhisper(actionOwnerReport, action, CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.NOTHING, isOriginalReportArchived, parentReport), }, @@ -89,7 +89,6 @@ function MentionWhisperContent({action, actionOwnerReportStable, parentReport, o {buttons.length > 0 && ( )} diff --git a/src/pages/inbox/report/actionContents/ReportMentionWhisperContent.tsx b/src/pages/inbox/report/actionContents/ReportMentionWhisperContent.tsx index 97e3d8866f53..03325b14f6e1 100644 --- a/src/pages/inbox/report/actionContents/ReportMentionWhisperContent.tsx +++ b/src/pages/inbox/report/actionContents/ReportMentionWhisperContent.tsx @@ -44,13 +44,13 @@ function ReportMentionWhisperContent({action, reportID, actionOwnerReportStable} ? [] : [ { - text: 'common.yes', + translationKey: 'common.yes', key: `${action.reportActionID}-actionableReportMentionWhisper-${CONST.REPORT.ACTIONABLE_REPORT_MENTION_WHISPER_RESOLUTION.CREATE}`, onPress: () => resolveActionableReportMentionWhisper(actionOwnerReport, action, CONST.REPORT.ACTIONABLE_REPORT_MENTION_WHISPER_RESOLUTION.CREATE, isReportArchived), isPrimary: true, }, { - text: 'common.no', + translationKey: 'common.no', key: `${action.reportActionID}-actionableReportMentionWhisper-${CONST.REPORT.ACTIONABLE_REPORT_MENTION_WHISPER_RESOLUTION.NOTHING}`, onPress: () => resolveActionableReportMentionWhisper(actionOwnerReport, action, CONST.REPORT.ACTIONABLE_REPORT_MENTION_WHISPER_RESOLUTION.NOTHING, isReportArchived), }, @@ -67,7 +67,6 @@ function ReportMentionWhisperContent({action, reportID, actionOwnerReportStable} {buttons.length > 0 && ( )}