Skip to content

Commit b9e49b8

Browse files
committed
Merge branch 'main' of github.com:mananjadhav/App into fix/mj-75075-hold-modal-rhp
2 parents 38dacc0 + fbed79d commit b9e49b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1136
-970
lines changed

src/CONST/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7224,6 +7224,7 @@ const CONST = {
72247224
HAS_PHONE_NUMBER_ERROR: 'hasPhoneNumberError',
72257225
HAS_CARD_CONNECTION_ERROR: 'hasCardConnectionError',
72267226
HAS_UBER_CREDENTIALS_ERROR: 'hasUberCredentialsError',
7227+
HAS_PARTIALLY_SETUP_BANK_ACCOUNT_INFO: 'hasPartiallySetupBankAccountInfo',
72277228
},
72287229

72297230
DEBUG: {

src/components/Icon/chunks/illustrations.chunk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ const Illustrations = {
192192
MagnifyingGlassMoney,
193193
MoneyReceipts,
194194
MoneyWings,
195+
MoneyIntoWallet,
195196
PerDiem,
196197
RealtimeReport,
197198
ReceiptWrangler,
@@ -203,7 +204,6 @@ const Illustrations = {
203204
ThumbsDown,
204205
TreasureChest,
205206
ExpensifyMobileApp,
206-
MoneyIntoWallet,
207207
PalmTree,
208208
PaperAirplane,
209209
PiggyBank,

src/components/MenuItem.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ type MenuItemBaseProps = {
7777
/** Text to be shown as badge near the right end. */
7878
badgeText?: string;
7979

80+
/** Icon to display on the left side of the badge */
81+
badgeIcon?: IconAsset;
82+
83+
/** Whether the badge should be shown as success */
84+
badgeSuccess?: boolean;
85+
8086
/** Used to apply offline styles to child text components */
8187
style?: StyleProp<ViewStyle>;
8288

@@ -396,10 +402,13 @@ const getSubscriptAvatarBackgroundColor = (isHovered: boolean, isPressed: boolea
396402
return hoveredBackgroundColor;
397403
}
398404
};
405+
399406
function MenuItem({
400407
interactive = true,
401408
onPress,
402409
badgeText,
410+
badgeIcon,
411+
badgeSuccess,
403412
style,
404413
wrapperStyle,
405414
titleWrapperStyle,
@@ -898,7 +907,9 @@ function MenuItem({
898907
{!!badgeText && (
899908
<Badge
900909
text={badgeText}
910+
icon={badgeIcon}
901911
badgeStyles={badgeStyle}
912+
success={badgeSuccess}
902913
/>
903914
)}
904915
{/* Since subtitle can be of type number, we should allow 0 to be shown */}
@@ -929,7 +940,7 @@ function MenuItem({
929940
<View style={[styles.alignItemsCenter, styles.justifyContentCenter, styles.ml1]}>
930941
<Icon
931942
src={Expensicons.DotIndicator}
932-
fill={brickRoadIndicator === 'error' ? theme.danger : theme.success}
943+
fill={brickRoadIndicator === CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR ? theme.danger : theme.success}
933944
/>
934945
</View>
935946
)}

src/components/ThreeDotsMenu/index.tsx

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -68,34 +68,12 @@ function ThreeDotsMenu({
6868
setPopupMenuVisible(false);
6969
}, []);
7070

71-
useImperativeHandle(threeDotsMenuRef as React.RefObject<{hidePopoverMenu: () => void; isPopupMenuVisible: boolean}> | undefined, () => ({
72-
isPopupMenuVisible,
73-
hidePopoverMenu,
74-
}));
75-
76-
useEffect(() => {
77-
if (!isBehindModal || !isPopupMenuVisible) {
78-
return;
79-
}
80-
hidePopoverMenu();
81-
}, [hidePopoverMenu, isBehindModal, isPopupMenuVisible]);
82-
8371
const {calculatePopoverPosition} = usePopoverPosition();
8472

8573
const calculateAndSetThreeDotsMenuPosition = useCallback(() => calculatePopoverPosition(buttonRef, anchorAlignment), [anchorAlignment, calculatePopoverPosition]);
8674

8775
const getMenuPosition = shouldSelfPosition ? calculateAndSetThreeDotsMenuPosition : getAnchorPosition;
8876

89-
useLayoutEffect(() => {
90-
if (!getMenuPosition || !isPopupMenuVisible) {
91-
return;
92-
}
93-
94-
getMenuPosition?.().then((value) => {
95-
setPosition(value);
96-
});
97-
}, [windowWidth, windowHeight, shouldSelfPosition, getMenuPosition, isPopupMenuVisible]);
98-
9977
const onThreeDotsPress = () => {
10078
if (isPopupMenuVisible) {
10179
hidePopoverMenu();
@@ -116,6 +94,29 @@ function ThreeDotsMenu({
11694
onIconPress?.();
11795
};
11896

97+
useImperativeHandle(threeDotsMenuRef as React.RefObject<{hidePopoverMenu: () => void; isPopupMenuVisible: boolean; onThreeDotsPress: () => void}> | undefined, () => ({
98+
isPopupMenuVisible,
99+
hidePopoverMenu,
100+
onThreeDotsPress,
101+
}));
102+
103+
useEffect(() => {
104+
if (!isBehindModal || !isPopupMenuVisible) {
105+
return;
106+
}
107+
hidePopoverMenu();
108+
}, [hidePopoverMenu, isBehindModal, isPopupMenuVisible]);
109+
110+
useLayoutEffect(() => {
111+
if (!getMenuPosition || !isPopupMenuVisible) {
112+
return;
113+
}
114+
115+
getMenuPosition?.().then((value) => {
116+
setPosition(value);
117+
});
118+
}, [windowWidth, windowHeight, shouldSelfPosition, getMenuPosition, isPopupMenuVisible]);
119+
119120
const TooltipToRender = shouldShowProductTrainingTooltip ? EducationalTooltip : Tooltip;
120121
const tooltipProps = shouldShowProductTrainingTooltip
121122
? {

src/components/ThreeDotsMenu/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {StyleProp, ViewStyle} from 'react-native';
1+
import type {GestureResponderEvent, StyleProp, ViewStyle} from 'react-native';
22
import type {PopoverMenuItem} from '@components/PopoverMenu';
33
import type {TranslationPaths} from '@src/languages/types';
44
import type {AnchorPosition} from '@src/styles';
@@ -19,7 +19,7 @@ type ThreeDotsMenuProps = {
1919
iconFill?: string;
2020

2121
/** Function to call on icon press */
22-
onIconPress?: () => void;
22+
onIconPress?: (() => void) | ((e?: GestureResponderEvent | KeyboardEvent | undefined) => void);
2323

2424
/** menuItems that'll show up on toggle of the popup menu */
2525
menuItems: PopoverMenuItem[];

src/hooks/useAccountTabIndicatorStatus.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type {ValueOf} from 'type-fest';
22
import {hasPaymentMethodError} from '@libs/actions/PaymentMethods';
3+
import {hasPartiallySetupBankAccount} from '@libs/BankAccountUtils';
34
import {checkIfFeedConnectionIsBroken} from '@libs/CardUtils';
45
import {hasSubscriptionGreenDotInfo, hasSubscriptionRedDotError} from '@libs/SubscriptionUtils';
56
import {hasLoginListError, hasLoginListInfo} from '@libs/UserUtils';
@@ -49,6 +50,7 @@ function useAccountTabIndicatorStatus(): AccountTabIndicatorStatusResult {
4950
const infoChecking: Partial<Record<AccountTabIndicatorStatus, boolean>> = {
5051
[CONST.INDICATOR_STATUS.HAS_LOGIN_LIST_INFO]: !!loginList && hasLoginListInfo(loginList, session?.email),
5152
[CONST.INDICATOR_STATUS.HAS_SUBSCRIPTION_INFO]: hasSubscriptionGreenDotInfo(stripeCustomerId, retryBillingSuccessful, billingDisputePending, retryBillingFailed),
53+
[CONST.INDICATOR_STATUS.HAS_PARTIALLY_SETUP_BANK_ACCOUNT_INFO]: hasPartiallySetupBankAccount(bankAccountList),
5254
};
5355

5456
const [error] = Object.entries(errorChecking).find(([, value]) => value) ?? [];

src/languages/de.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ const translations: TranslationDeepObject<typeof en> = {
700700
domains: 'Domänen',
701701
reportName: 'Berichtsname',
702702
showLess: 'Weniger anzeigen',
703+
actionRequired: 'Erforderliche Aktion',
703704
},
704705
supportalNoAccess: {
705706
title: 'Nicht so schnell',
@@ -2925,6 +2926,8 @@ ${
29252926
hasBeenThrottledError: 'Beim Hinzufügen Ihres Bankkontos ist ein Fehler aufgetreten. Bitte warten Sie ein paar Minuten und versuchen Sie es erneut.',
29262927
hasCurrencyError: ({workspaceRoute}: WorkspaceRouteParams) =>
29272928
`Ups! Es scheint, dass die Währung Ihres Arbeitsbereichs auf eine andere Währung als USD eingestellt ist. Um fortzufahren, gehen Sie bitte zu <a href="${workspaceRoute}">Ihre Arbeitsbereichseinstellungen</a> um es auf USD zu setzen und es erneut zu versuchen.`,
2929+
bbaAdded: 'Geschäftsbankkonto hinzugefügt!',
2930+
bbaAddedDescription: 'Es ist bereit für Zahlungen verwendet zu werden.',
29282931
error: {
29292932
youNeedToSelectAnOption: 'Bitte wählen Sie eine Option, um fortzufahren.',
29302933
noBankAccountAvailable: 'Entschuldigung, es ist kein Bankkonto verfügbar.',

src/languages/en.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@ const translations = {
694694
copyToClipboard: 'Copy to clipboard',
695695
thisIsTakingLongerThanExpected: 'This is taking longer than expected...',
696696
domains: 'Domains',
697+
actionRequired: 'Action required',
697698
},
698699
supportalNoAccess: {
699700
title: 'Not so fast',
@@ -3037,6 +3038,8 @@ const translations = {
30373038
hasBeenThrottledError: 'An error occurred while adding your bank account. Please wait a few minutes and try again.',
30383039
hasCurrencyError: ({workspaceRoute}: WorkspaceRouteParams) =>
30393040
`Oops! It appears that your workspace currency is set to a different currency than USD. To proceed, please go to <a href="${workspaceRoute}">your workspace settings</a> to set it to USD and try again.`,
3041+
bbaAdded: 'Business bank account added!',
3042+
bbaAddedDescription: "It's ready to be used for payments.",
30403043
error: {
30413044
youNeedToSelectAnOption: 'Please select an option to proceed',
30423045
noBankAccountAvailable: "Sorry, there's no bank account available",

src/languages/es.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ const translations: TranslationDeepObject<typeof en> = {
373373
copyToClipboard: 'Copiar al portapapeles',
374374
thisIsTakingLongerThanExpected: 'Está tardando más de lo esperado...',
375375
domains: 'Dominios',
376+
actionRequired: 'Acción requerida',
376377
},
377378
supportalNoAccess: {
378379
title: 'No tan rápido',
@@ -2680,6 +2681,8 @@ ${amount} para ${merchant} - ${date}`,
26802681
hasBeenThrottledError: 'Se ha producido un error al intentar añadir tu cuenta bancaria. Por favor, espera unos minutos e inténtalo de nuevo.',
26812682
hasCurrencyError: ({workspaceRoute}) =>
26822683
`¡Ups! Parece que la moneda de tu espacio de trabajo no está configurada en USD. Para continuar, ve a <a href="${workspaceRoute}">la configuración del área de trabajo</a>, configúrala en USD e inténtalo nuevamente.`,
2684+
bbaAdded: '¡Cuenta bancaria empresarial agregada!',
2685+
bbaAddedDescription: 'Está lista para ser utilizada en pagos.',
26832686
error: {
26842687
youNeedToSelectAnOption: 'Debes seleccionar una opción para continuar',
26852688
noBankAccountAvailable: 'Lo sentimos, no hay ninguna cuenta bancaria disponible',

src/languages/fr.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ const translations: TranslationDeepObject<typeof en> = {
700700
domains: 'Domaines',
701701
reportName: 'Nom du rapport',
702702
showLess: 'Afficher moins',
703+
actionRequired: 'Action requise',
703704
},
704705
supportalNoAccess: {
705706
title: 'Pas si vite',
@@ -2926,6 +2927,8 @@ ${
29262927
hasBeenThrottledError: "Une erreur s'est produite lors de l'ajout de votre compte bancaire. Veuillez attendre quelques minutes et réessayer.",
29272928
hasCurrencyError: ({workspaceRoute}: WorkspaceRouteParams) =>
29282929
`Oups ! Il semble que la devise de votre espace de travail soit différente de l'USD. Pour continuer, veuillez aller sur <a href="${workspaceRoute}">vos paramètres d'espace de travail</a> pour le régler sur USD et réessayer.`,
2930+
bbaAdded: 'Compte bancaire professionnel ajouté !',
2931+
bbaAddedDescription: 'Il est prêt à être utilisé pour les paiements.',
29292932
error: {
29302933
youNeedToSelectAnOption: 'Veuillez sélectionner une option pour continuer',
29312934
noBankAccountAvailable: "Désolé, aucun compte bancaire n'est disponible.",

0 commit comments

Comments
 (0)