From 496110e0406d1b46ef39c17f8397d2e5c997bf91 Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 26 Jul 2024 16:18:14 +0700 Subject: [PATCH 01/71] fix update settings button title in web --- src/components/LocationPermissionModal/index.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/LocationPermissionModal/index.tsx b/src/components/LocationPermissionModal/index.tsx index 2bc4a7393822..49dfb8121167 100644 --- a/src/components/LocationPermissionModal/index.tsx +++ b/src/components/LocationPermissionModal/index.tsx @@ -5,7 +5,9 @@ import ConfirmModal from '@components/ConfirmModal'; import * as Illustrations from '@components/Icon/Illustrations'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; +import getPlatform from '@libs/getPlatform'; import {getLocationPermission, requestLocationPermission} from '@pages/iou/request/step/IOURequestStepScan/LocationPermission'; +import CONST from '@src/CONST'; import type {LocationPermissionModalProps} from './types'; function LocationPermissionModal({startPermissionFlow, resetPermissionFlow, onDeny, onGrant}: LocationPermissionModalProps) { @@ -15,6 +17,8 @@ function LocationPermissionModal({startPermissionFlow, resetPermissionFlow, onDe const styles = useThemeStyles(); const {translate} = useLocalize(); + const isWeb = getPlatform() === CONST.PLATFORM.WEB; + useEffect(() => { if (!startPermissionFlow) { return; @@ -32,8 +36,10 @@ function LocationPermissionModal({startPermissionFlow, resetPermissionFlow, onDe }, [startPermissionFlow]); const handledBlockedPermission = (cb: () => void) => () => { - if (hasError && Linking.openSettings) { - Linking.openSettings(); + if (hasError) { + if (Linking.openSettings) { + Linking.openSettings(); + } setShowModal(false); setHasError(false); resetPermissionFlow(); @@ -68,7 +74,7 @@ function LocationPermissionModal({startPermissionFlow, resetPermissionFlow, onDe isVisible={showModal} onConfirm={grantLocationPermission} onCancel={skipLocationPermission} - confirmText={hasError ? translate('common.settings') : translate('common.continue')} + confirmText={hasError ? (isWeb ? translate('common.buttonConfirm') : translate('common.settings')) : translate('common.continue')} cancelText={translate('common.notNow')} prompt={translate(hasError ? 'receipt.locationErrorMessage' : 'receipt.locationAccessMessage')} promptStyles={[styles.textLabelSupportingEmptyValue, styles.mb4]} From b251c17a1af9824032d06ae3dbcfeac655d9f9af Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 26 Jul 2024 16:42:09 +0700 Subject: [PATCH 02/71] fix lint --- src/components/LocationPermissionModal/index.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/LocationPermissionModal/index.tsx b/src/components/LocationPermissionModal/index.tsx index 49dfb8121167..53fa6928b90d 100644 --- a/src/components/LocationPermissionModal/index.tsx +++ b/src/components/LocationPermissionModal/index.tsx @@ -69,12 +69,20 @@ function LocationPermissionModal({startPermissionFlow, resetPermissionFlow, onDe setHasError(false); }; + const getConfirmText = (): string => { + if (!hasError) { + return translate('common.continue'); + } + + return isWeb ? translate('common.buttonConfirm') : translate('common.settings'); + }; + return ( Date: Fri, 26 Jul 2024 19:57:45 +0200 Subject: [PATCH 03/71] add translations --- src/languages/en.ts | 1 + src/languages/es.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/languages/en.ts b/src/languages/en.ts index 1cb58198425f..554d51771ddc 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -4153,6 +4153,7 @@ export default { changeCurrency: 'Change payment currency', cardNotFound: 'No payment card added', retryPaymentButton: 'Retry payment', + authenticatePayment: 'Authenticate payment', requestRefund: 'Request refund', requestRefundModal: { phrase1: 'Getting a refund is easy, just downgrade your account before your next billing date and you’ll receive a refund.', diff --git a/src/languages/es.ts b/src/languages/es.ts index 92936b6371ee..7657aef1b6da 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -4676,6 +4676,7 @@ export default { changeCurrency: 'Cambiar moneda de pago', cardNotFound: 'No se ha añadido ninguna tarjeta de pago', retryPaymentButton: 'Reintentar el pago', + authenticatePayment: 'Autenticar el pago', requestRefund: 'Solicitar reembolso', requestRefundModal: { phrase1: 'Obtener un reembolso es fácil, simplemente baja tu cuenta de categoría antes de la próxima fecha de facturación y recibirás un reembolso.', From fdb3a16dc808feb69d2a73504e17318972da76e0 Mon Sep 17 00:00:00 2001 From: Artem Makushov Date: Fri, 26 Jul 2024 19:58:50 +0200 Subject: [PATCH 04/71] add authenticate button --- .../Subscription/CardSection/CardSection.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/pages/settings/Subscription/CardSection/CardSection.tsx b/src/pages/settings/Subscription/CardSection/CardSection.tsx index 049728a85614..df3c6809e1de 100644 --- a/src/pages/settings/Subscription/CardSection/CardSection.tsx +++ b/src/pages/settings/Subscription/CardSection/CardSection.tsx @@ -70,6 +70,10 @@ function CardSection() { Subscription.clearOutstandingBalance(); }; + const handleAuthenticatePayment = () => { + Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD); + }; + const handleBillingBannerClose = () => { setBillingStatus(undefined); }; @@ -140,6 +144,16 @@ function CardSection() { large /> )} + {billingStatus?.isAuthenticationRequired !== undefined && ( +