From 595cd5d302a5b601e50b8ed72f5aa0e86d3ccf82 Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Thu, 26 Oct 2023 15:06:35 +0200 Subject: [PATCH 01/10] draft button implementation --- src/pages/ShareCodePage.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pages/ShareCodePage.js b/src/pages/ShareCodePage.js index d6a6b79d3273..b7c1f59a1803 100644 --- a/src/pages/ShareCodePage.js +++ b/src/pages/ShareCodePage.js @@ -97,6 +97,15 @@ class ShareCodePage extends React.Component { + Navigation.navigate()} + /> + Date: Fri, 17 Nov 2023 18:54:39 +0100 Subject: [PATCH 02/10] add share code type --- src/CONST.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CONST.ts b/src/CONST.ts index 55beabb8e85e..2ee6f81f83f5 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -2895,6 +2895,7 @@ const CONST = { START_CHAT: 'startChat', SEND_MONEY: 'sendMoney', REFER_FRIEND: 'referralFriend', + SHARE_CODE: 'shareCode', }, REVENUE: 250, LEARN_MORE_LINK: 'https://help.expensify.com/articles/new-expensify/getting-started/Referral-Program', From 916b2abb02eea41476decf6ae953c87ec18ea420 Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Fri, 17 Nov 2023 18:54:46 +0100 Subject: [PATCH 03/10] add strings --- src/languages/en.ts | 14 ++++++++++---- src/languages/es.ts | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index fc43524672ee..1071f63e4551 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1914,25 +1914,31 @@ export default { buttonText1: 'Start a chat, ', buttonText2: `get $${CONST.REFERRAL_PROGRAM.REVENUE}.`, header: `Start a chat, get $${CONST.REFERRAL_PROGRAM.REVENUE}`, - body: `Start a chat with a new Expensify account. Get $${CONST.REFERRAL_PROGRAM.REVENUE} once they start an annual subscription with two or more active members and make the first two payments toward their Expensify bill.`, + body1: `Start a chat with a new Expensify account. Get $${CONST.REFERRAL_PROGRAM.REVENUE} once they start an annual subscription with two or more active members and make the first two payments toward their Expensify bill.`, }, [CONST.REFERRAL_PROGRAM.CONTENT_TYPES.MONEY_REQUEST]: { buttonText1: 'Request money, ', buttonText2: `get $${CONST.REFERRAL_PROGRAM.REVENUE}.`, header: `Request money, get $${CONST.REFERRAL_PROGRAM.REVENUE}`, - body: `Request money from a new Expensify account. Get $${CONST.REFERRAL_PROGRAM.REVENUE} once they start an annual subscription with two or more active members and make the first two payments toward their Expensify bill.`, + body1: `Request money from a new Expensify account. Get $${CONST.REFERRAL_PROGRAM.REVENUE} once they start an annual subscription with two or more active members and make the first two payments toward their Expensify bill.`, }, [CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SEND_MONEY]: { buttonText1: 'Send money, ', buttonText2: `get $${CONST.REFERRAL_PROGRAM.REVENUE}.`, header: `Send money, get $${CONST.REFERRAL_PROGRAM.REVENUE}`, - body: `Send money to a new Expensify account. Get $${CONST.REFERRAL_PROGRAM.REVENUE} once they start an annual subscription with two or more active members and make the first two payments toward their Expensify bill.`, + body1: `Send money to a new Expensify account. Get $${CONST.REFERRAL_PROGRAM.REVENUE} once they start an annual subscription with two or more active members and make the first two payments toward their Expensify bill.`, }, [CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND]: { buttonText1: 'Refer a friend, ', buttonText2: `get $${CONST.REFERRAL_PROGRAM.REVENUE}.`, header: `Refer a friend, get $${CONST.REFERRAL_PROGRAM.REVENUE}`, - body: `Send your Expensify referral link to a friend or anyone else you know who spends too much time on expenses. When they start an annual subscription, you'll get $${CONST.REFERRAL_PROGRAM.REVENUE}.`, + body1: `Send your Expensify referral link to a friend or anyone else you know who spends too much time on expenses. When they start an annual subscription, you'll get $${CONST.REFERRAL_PROGRAM.REVENUE}.`, + }, + [CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SHARE_CODE]: { + buttonText1: `Get $${CONST.REFERRAL_PROGRAM.REVENUE}`, + header: `Get $${CONST.REFERRAL_PROGRAM.REVENUE} for every referral`, + body1: 'If you know anyone who’s spending too much time on expenses (literally anyone – your neighbor, your boss, your friend in accounting), send them your Expensify referral link:', + body2: `When they start an annual subscription, you’ll get $${CONST.REFERRAL_PROGRAM.REVENUE}. Easy as that.`, }, copyReferralLink: 'Copy referral link', }, diff --git a/src/languages/es.ts b/src/languages/es.ts index 606bbb8bfa51..c8c38002e85c 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2398,25 +2398,31 @@ export default { buttonText1: 'Inicia un chat y ', buttonText2: `recibe $${CONST.REFERRAL_PROGRAM.REVENUE}`, header: `Inicia un chat y recibe $${CONST.REFERRAL_PROGRAM.REVENUE}`, - body: `Inicia un chat con una cuenta nueva de Expensify. Obtiene $${CONST.REFERRAL_PROGRAM.REVENUE} una vez que configuren una suscripción anual con dos o más miembros activos y realicen los dos primeros pagos de su factura Expensify.`, + body1: `Inicia un chat con una cuenta nueva de Expensify. Obtiene $${CONST.REFERRAL_PROGRAM.REVENUE} una vez que configuren una suscripción anual con dos o más miembros activos y realicen los dos primeros pagos de su factura Expensify.`, }, [CONST.REFERRAL_PROGRAM.CONTENT_TYPES.MONEY_REQUEST]: { buttonText1: 'Pide dinero, ', buttonText2: `recibe $${CONST.REFERRAL_PROGRAM.REVENUE}`, header: `Pide dinero y recibe $${CONST.REFERRAL_PROGRAM.REVENUE}`, - body: `Pide dinero a una cuenta nueva de Expensify. Obtiene $${CONST.REFERRAL_PROGRAM.REVENUE} una vez que configuren una suscripción anual con dos o más miembros activos y realicen los dos primeros pagos de su factura Expensify.`, + body1: `Pide dinero a una cuenta nueva de Expensify. Obtiene $${CONST.REFERRAL_PROGRAM.REVENUE} una vez que configuren una suscripción anual con dos o más miembros activos y realicen los dos primeros pagos de su factura Expensify.`, }, [CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SEND_MONEY]: { buttonText1: 'Envía dinero, ', buttonText2: `recibe $${CONST.REFERRAL_PROGRAM.REVENUE}`, header: `Envía dinero y recibe $${CONST.REFERRAL_PROGRAM.REVENUE}`, - body: `Envía dinero a una cuenta nueva de Expensify. Obtiene $${CONST.REFERRAL_PROGRAM.REVENUE} una vez que configuren una suscripción anual con dos o más miembros activos y realicen los dos primeros pagos de su factura Expensify.`, + body1: `Envía dinero a una cuenta nueva de Expensify. Obtiene $${CONST.REFERRAL_PROGRAM.REVENUE} una vez que configuren una suscripción anual con dos o más miembros activos y realicen los dos primeros pagos de su factura Expensify.`, }, [CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND]: { buttonText1: 'Recomienda a un amigo y ', buttonText2: `recibe $${CONST.REFERRAL_PROGRAM.REVENUE}`, header: `Recomienda a un amigo y recibe $${CONST.REFERRAL_PROGRAM.REVENUE}`, - body: `Envía tu enlace de invitación de Expensify a un amigo o a cualquier otra persona que conozcas que dedique demasiado tiempo a los gastos. Cuando comiencen una suscripción anual, obtendrás $${CONST.REFERRAL_PROGRAM.REVENUE}.`, + body1: `Envía tu enlace de invitación de Expensify a un amigo o a cualquier otra persona que conozcas que dedique demasiado tiempo a los gastos. Cuando comiencen una suscripción anual, obtendrás $${CONST.REFERRAL_PROGRAM.REVENUE}.`, + }, + [CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SHARE_CODE]: { + buttonText1: `Get $${CONST.REFERRAL_PROGRAM.REVENUE}`, + header: `Get $${CONST.REFERRAL_PROGRAM.REVENUE} for every referral`, + body1: 'If you know anyone who’s spending too much time on expenses (literally anyone – your neighbor, your boss, your friend in accounting), send them your Expensify referral link:', + body2: `When they start an annual subscription, you’ll get $${CONST.REFERRAL_PROGRAM.REVENUE}. Easy as that.`, }, copyReferralLink: 'Copiar enlace de invitación', }, From 021dea5d7f327746f55fb2237d9b11a4e1883d1e Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Fri, 17 Nov 2023 18:54:56 +0100 Subject: [PATCH 04/10] integrate share code type --- src/pages/ReferralDetailsPage.js | 11 +++++++++-- src/pages/ShareCodePage.js | 6 ++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/pages/ReferralDetailsPage.js b/src/pages/ReferralDetailsPage.js index 282e85fe0237..566bc5bd55dc 100644 --- a/src/pages/ReferralDetailsPage.js +++ b/src/pages/ReferralDetailsPage.js @@ -45,8 +45,10 @@ function ReferralDetailsPage({route, account}) { if (!_.includes(_.values(CONST.REFERRAL_PROGRAM.CONTENT_TYPES), contentType)) { contentType = CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND; } + const contentHeader = translate(`referralProgram.${contentType}.header`); - const contentBody = translate(`referralProgram.${contentType}.body`); + const contentBody = translate(`referralProgram.${contentType}.body1`); + const shouldShowClipboard = contentType === CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND || contentType === CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SHARE_CODE; function generateReferralURL(email) { return `${CONST.REFERRAL_PROGRAM.LINK}/?thanks=${encodeURIComponent(email)}`; @@ -70,7 +72,7 @@ function ReferralDetailsPage({route, account}) { /> {contentHeader} {contentBody} - {contentType === CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND && ( + {shouldShowClipboard && ( )} + {contentType === CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SHARE_CODE && ( + + {translate(`referralProgram.${CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SHARE_CODE}.body2`)} + + )} {translate('requestorStep.learnMore')} diff --git a/src/pages/ShareCodePage.js b/src/pages/ShareCodePage.js index 47a64313b925..21e14fe95e22 100644 --- a/src/pages/ShareCodePage.js +++ b/src/pages/ShareCodePage.js @@ -100,11 +100,9 @@ class ShareCodePage extends React.Component { Navigation.navigate()} + onPress={() => Navigation.navigate(ROUTES.REFERRAL_DETAILS_MODAL.getRoute(CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SHARE_CODE))} /> Date: Sat, 18 Nov 2023 13:36:56 +0100 Subject: [PATCH 05/10] prettify ReferralDetailsPage --- src/pages/ReferralDetailsPage.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pages/ReferralDetailsPage.js b/src/pages/ReferralDetailsPage.js index 566bc5bd55dc..771bc5d4b8fc 100644 --- a/src/pages/ReferralDetailsPage.js +++ b/src/pages/ReferralDetailsPage.js @@ -48,7 +48,9 @@ function ReferralDetailsPage({route, account}) { const contentHeader = translate(`referralProgram.${contentType}.header`); const contentBody = translate(`referralProgram.${contentType}.body1`); - const shouldShowClipboard = contentType === CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND || contentType === CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SHARE_CODE; + const isShareCode = contentType === CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SHARE_CODE; + const shouldShowBody2 = isShareCode; + const shouldShowClipboard = contentType === CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND || isShareCode; function generateReferralURL(email) { return `${CONST.REFERRAL_PROGRAM.LINK}/?thanks=${encodeURIComponent(email)}`; @@ -62,7 +64,7 @@ function ReferralDetailsPage({route, account}) { > Navigation.goBack()} + onBackButtonPress={Navigation.goBack} /> )} - {contentType === CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SHARE_CODE && ( + {shouldShowBody2 && ( {translate(`referralProgram.${CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SHARE_CODE}.body2`)} @@ -93,7 +95,7 @@ function ReferralDetailsPage({route, account}) { success style={[styles.w100]} text={translate('common.buttonConfirm')} - onPress={() => Navigation.goBack()} + onPress={Navigation.goBack} pressOnEnter enterKeyEventListenerPriority={1} /> From 03d0a6651d453333c0ef6a2d430331c751648710 Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Mon, 20 Nov 2023 19:40:11 +0100 Subject: [PATCH 06/10] translate to Spanish --- src/languages/es.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index 0c69c60c09d2..021f86f675fd 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2419,10 +2419,10 @@ export default { body1: `Envía tu enlace de invitación de Expensify a un amigo o a cualquier otra persona que conozcas que dedique demasiado tiempo a los gastos. Cuando comiencen una suscripción anual, obtendrás $${CONST.REFERRAL_PROGRAM.REVENUE}.`, }, [CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SHARE_CODE]: { - buttonText1: `Get $${CONST.REFERRAL_PROGRAM.REVENUE}`, - header: `Get $${CONST.REFERRAL_PROGRAM.REVENUE} for every referral`, - body1: 'If you know anyone who’s spending too much time on expenses (literally anyone – your neighbor, your boss, your friend in accounting), send them your Expensify referral link:', - body2: `When they start an annual subscription, you’ll get $${CONST.REFERRAL_PROGRAM.REVENUE}. Easy as that.`, + buttonText1: `Recibe $${CONST.REFERRAL_PROGRAM.REVENUE}`, + header: `Recibe $${CONST.REFERRAL_PROGRAM.REVENUE} por cada recomendación`, + body1: 'Si conoces a alguien que dedique demasiado tiempo a los gastos (literalmente cualquiera: tu vecino, tu jefe, tu amigo de contabilidad), envíale tu enlace de invitación de Expensify:', + body2: `Cuando comiencen una suscripción anual, obtendrás $${CONST.REFERRAL_PROGRAM.REVENUE}. Así de fácil.`, }, copyReferralLink: 'Copiar enlace de invitación', }, From fc06300df8a16cce77157f72e32264692637f338 Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Mon, 20 Nov 2023 19:46:33 +0100 Subject: [PATCH 07/10] align title --- src/pages/ReferralDetailsPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ReferralDetailsPage.js b/src/pages/ReferralDetailsPage.js index 771bc5d4b8fc..d39930b0d7c3 100644 --- a/src/pages/ReferralDetailsPage.js +++ b/src/pages/ReferralDetailsPage.js @@ -72,7 +72,7 @@ function ReferralDetailsPage({route, account}) { width={178} height={232} /> - {contentHeader} + {contentHeader} {contentBody} {shouldShowClipboard && ( From e5003dfdf09ec339fba74952f03c198edd912513 Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Tue, 21 Nov 2023 16:12:32 +0100 Subject: [PATCH 08/10] pass the fallback --- src/pages/ReferralDetailsPage.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/ReferralDetailsPage.js b/src/pages/ReferralDetailsPage.js index d39930b0d7c3..30026c1f5eed 100644 --- a/src/pages/ReferralDetailsPage.js +++ b/src/pages/ReferralDetailsPage.js @@ -17,6 +17,7 @@ import Navigation from '@libs/Navigation/Navigation'; import styles from '@styles/styles'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; +import ROUTES from '@src/ROUTES'; const propTypes = { /** Navigation route context info provided by react navigation */ @@ -64,7 +65,7 @@ function ReferralDetailsPage({route, account}) { > Navigation.goBack(ROUTES.HOME)} /> Navigation.goBack(ROUTES.HOME)} pressOnEnter enterKeyEventListenerPriority={1} /> From 1a359807efbe26c8eee9bc537e92ce89d458cb44 Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Tue, 21 Nov 2023 16:14:55 +0100 Subject: [PATCH 09/10] not allow for anonymous --- src/pages/ShareCodePage.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/ShareCodePage.js b/src/pages/ShareCodePage.js index 21e14fe95e22..8bcb15c30226 100644 --- a/src/pages/ShareCodePage.js +++ b/src/pages/ShareCodePage.js @@ -99,7 +99,6 @@ class ShareCodePage extends React.Component { Navigation.navigate(ROUTES.REFERRAL_DETAILS_MODAL.getRoute(CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SHARE_CODE))} From 3eb2d158b46550a7ab73e86736820fbca0fa12d7 Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Fri, 24 Nov 2023 11:58:45 +0100 Subject: [PATCH 10/10] move button down --- src/pages/ShareCodePage.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/ShareCodePage.js b/src/pages/ShareCodePage.js index 8bcb15c30226..d81593fb552a 100644 --- a/src/pages/ShareCodePage.js +++ b/src/pages/ShareCodePage.js @@ -98,12 +98,6 @@ class ShareCodePage extends React.Component { - Navigation.navigate(ROUTES.REFERRAL_DETAILS_MODAL.getRoute(CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SHARE_CODE))} - /> - Clipboard.setString(url)} /> + Navigation.navigate(ROUTES.REFERRAL_DETAILS_MODAL.getRoute(CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SHARE_CODE))} + /> + {isNative && (