From 6acacd93d0287824bde0dc80f0cb9603784a5d96 Mon Sep 17 00:00:00 2001 From: Andrei Dekterev Date: Thu, 12 Jan 2023 18:47:28 +0700 Subject: [PATCH] fix(#247): add inform to cancel sub for gpay --- src/config/lexics/payment.tsx | 1 + .../components/CancelSubPopup/index.tsx | 61 +++++++++++-------- src/requests/getUserSubscribes.tsx | 1 + 3 files changed, 37 insertions(+), 26 deletions(-) diff --git a/src/config/lexics/payment.tsx b/src/config/lexics/payment.tsx index 7a1e7ed3..fc1e0580 100644 --- a/src/config/lexics/payment.tsx +++ b/src/config/lexics/payment.tsx @@ -20,6 +20,7 @@ export const paymentLexics = { error_empty_state: 19821, error_payment_unsuccessful: 14446, if_you_cancel: 18189, + is_gpay: 20045, next_payment: 18183, notify_by_email: 18366, order_received: 18365, diff --git a/src/features/UserAccount/components/CancelSubPopup/index.tsx b/src/features/UserAccount/components/CancelSubPopup/index.tsx index 10e2ae82..da2785c0 100644 --- a/src/features/UserAccount/components/CancelSubPopup/index.tsx +++ b/src/features/UserAccount/components/CancelSubPopup/index.tsx @@ -43,12 +43,13 @@ export const CancelSubPopup = (props: Props) => { const { access_to, + is_gpay, lexic, option_sys_name, } = subscribe return ( - + {isSubCanceled || error ? ( @@ -65,32 +66,40 @@ export const CancelSubPopup = (props: Props) => { - - - - - {option_sys_name && `${option_sys_name[0].toUpperCase()}${option_sys_name.slice(1, option_sys_name.length)}`} — - - - + {is_gpay ? ( + + + + ) : ( + <> + + + + + {option_sys_name && `${option_sys_name[0].toUpperCase()}${option_sys_name.slice(1, option_sys_name.length)}`} — + + +   - {access_to && format(new Date(access_to), 'dd.MM.yyyy')} - -
- cancelSub()} - isFetching={isFetching} - > - {isFetching ? ( - - ) : ( - - )} - - handleModalClose()}> - - -
+ {access_to && format(new Date(access_to), 'dd.MM.yyyy')} +
+ + + )} )} diff --git a/src/requests/getUserSubscribes.tsx b/src/requests/getUserSubscribes.tsx index ba27bc2a..3154e129 100644 --- a/src/requests/getUserSubscribes.tsx +++ b/src/requests/getUserSubscribes.tsx @@ -12,6 +12,7 @@ export type Subscribe = { dt_next_billing: string | null, is_access: boolean, is_active: boolean, + is_gpay?: boolean, iso: string, lexic: number, lexic1: number,