From dab8905a82200fb40fc914a33e0af89f1af3d891 Mon Sep 17 00:00:00 2001 From: Ben Goldberg Date: Fri, 8 Dec 2023 10:48:34 -0800 Subject: [PATCH 01/10] additional onboard error handling --- src/screens/SignTransactionSheet.tsx | 1 - src/screens/points/content/console/initialize.tsx | 2 +- src/screens/points/contexts/PointsProfileContext.tsx | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/screens/SignTransactionSheet.tsx b/src/screens/SignTransactionSheet.tsx index 33bf6a92514..e1e2aac9b3e 100644 --- a/src/screens/SignTransactionSheet.tsx +++ b/src/screens/SignTransactionSheet.tsx @@ -1654,7 +1654,6 @@ const SimulationCard = ({ simulationError, ]); - console.log({ simulationScanResult }); return ( Date: Fri, 8 Dec 2023 11:30:29 -0800 Subject: [PATCH 02/10] fix skip --- src/screens/points/content/console/review.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/screens/points/content/console/review.tsx b/src/screens/points/content/console/review.tsx index 7dda8474acf..1590e0a2378 100644 --- a/src/screens/points/content/console/review.tsx +++ b/src/screens/points/content/console/review.tsx @@ -51,7 +51,7 @@ export const Review = () => { )}`} /> - {shareBonusPoints && ( + {shareBonusPoints ? ( { textContent={`+ ${shareBonusPoints}`} /> + ) : ( + <> )} Date: Fri, 8 Dec 2023 11:31:59 -0800 Subject: [PATCH 03/10] copy --- src/languages/en_US.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/en_US.json b/src/languages/en_US.json index 93619bed265..b33f2aa7be8 100644 --- a/src/languages/en_US.json +++ b/src/languages/en_US.json @@ -1270,7 +1270,7 @@ "error": "Oops!\nPlease pull to refresh.", "points": "points", "referral_code_copied": "Referral code copied", - "earn_points_for_referring": "Earn points for referring friends once they swap $100 through Rainbow" + "earn_points_for_referring": "Earn points when your referrals swap $100 through Rainbow, plus earn 10% of the points your referrals earn" }, "console": { "claim_bonus_paragraph": "You'll receive an additional 100 points once you swap at least $100 through Rainbow", From 22e213aceea893483e6149afbec3708003825dcf Mon Sep 17 00:00:00 2001 From: Ben Goldberg Date: Fri, 8 Dec 2023 12:00:41 -0800 Subject: [PATCH 04/10] bump referral keyboard delay --- src/screens/points/content/ReferralContent.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/screens/points/content/ReferralContent.tsx b/src/screens/points/content/ReferralContent.tsx index b931c792dd5..f0354799f48 100644 --- a/src/screens/points/content/ReferralContent.tsx +++ b/src/screens/points/content/ReferralContent.tsx @@ -22,7 +22,7 @@ import { haptics } from '@/utils'; import { delay } from '@/utils/delay'; import { useFocusEffect } from '@react-navigation/native'; import React, { useCallback, useEffect, useState } from 'react'; -import { Keyboard, TextInput } from 'react-native'; +import { InteractionManager, Keyboard, TextInput } from 'react-native'; import Animated, { useAnimatedStyle, useSharedValue, @@ -95,7 +95,7 @@ export default function ReferralContent() { useFocusEffect( useCallback(() => { - delay(400).then(() => textInputRef.current?.focus()); + delay(600).then(() => textInputRef.current?.focus()); return () => { setReferralCodeDisplay(''); From 7af3e44578f43f10876f68b1ad3322df32f4ccb0 Mon Sep 17 00:00:00 2001 From: Ben Goldberg Date: Fri, 8 Dec 2023 12:04:07 -0800 Subject: [PATCH 05/10] fix double referral link when sharing --- src/screens/points/content/PointsContent.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/screens/points/content/PointsContent.tsx b/src/screens/points/content/PointsContent.tsx index f4709dca362..89a967878b9 100644 --- a/src/screens/points/content/PointsContent.tsx +++ b/src/screens/points/content/PointsContent.tsx @@ -537,7 +537,6 @@ export default function PointsContent() { message: referralUrl, } : { - message: referralUrl, url: referralUrl, } ); From 2cb05ec9ab4e2e58b12e0beccacaae00e2c9a421 Mon Sep 17 00:00:00 2001 From: Ben Goldberg Date: Fri, 8 Dec 2023 15:03:49 -0800 Subject: [PATCH 06/10] fix next drop card date conversion --- src/helpers/utilities.ts | 3 ++- src/screens/points/content/PointsContent.tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/helpers/utilities.ts b/src/helpers/utilities.ts index c30d908185d..35beb4ac7a5 100644 --- a/src/helpers/utilities.ts +++ b/src/helpers/utilities.ts @@ -611,7 +611,8 @@ export const getFormattedTimeQuantity = ( ms: number, maxUnits?: number ): string => { - const totalMinutes = Math.ceil(ms / (1000 * 60)); + const totalSeconds = ms / 1000; + const totalMinutes = Math.ceil(totalSeconds / 60); const totalHours = Math.floor(totalMinutes / 60); const days = Math.floor(totalHours / 24); const hours = totalHours % 24; diff --git a/src/screens/points/content/PointsContent.tsx b/src/screens/points/content/PointsContent.tsx index 89a967878b9..235cce69868 100644 --- a/src/screens/points/content/PointsContent.tsx +++ b/src/screens/points/content/PointsContent.tsx @@ -444,7 +444,7 @@ export default function PointsContent() { // onPress={() => {}} title={i18n.t(i18n.l.points.points.next_drop)} mainText={getFormattedTimeQuantity( - nextDistributionSeconds, + nextDistributionSeconds * 1000 - Date.now(), 2 )} icon="􀉉" From 228590b035c6bcbe7764762ac2897d868e7d6123 Mon Sep 17 00:00:00 2001 From: Ben Goldberg Date: Fri, 8 Dec 2023 15:05:33 -0800 Subject: [PATCH 07/10] tweak refetch interval slightly --- src/resources/points.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/points.ts b/src/resources/points.ts index 350b8ed7bcc..23bba343b80 100644 --- a/src/resources/points.ts +++ b/src/resources/points.ts @@ -32,7 +32,7 @@ export function usePoints({ walletAddress }: { walletAddress: string }) { useEffect(() => { const nextDistribution = query?.data?.points?.meta?.distribution?.next; - if (nextDistribution && Date.now() / 1000 > nextDistribution) { + if (nextDistribution && Date.now() >= nextDistribution * 1000) { query.refetch(); } }, [query]); From ccb7c72cd3599cb54029b3c0299d3825c9c54ef4 Mon Sep 17 00:00:00 2001 From: Ben Goldberg Date: Fri, 8 Dec 2023 15:11:00 -0800 Subject: [PATCH 08/10] twitter intent tweak --- src/screens/points/constants.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/screens/points/constants.ts b/src/screens/points/constants.ts index 78b38ef3cfc..785d2e4b33a 100644 --- a/src/screens/points/constants.ts +++ b/src/screens/points/constants.ts @@ -91,7 +91,9 @@ export const buildTwitterIntentMessage = ( let text = rainbows; text += encodeURIComponent('\n\n'); text += encodeURIComponent( - `I just had ${ONBOARDING_TOTAL_POINTS} Rainbow Points dropped into my wallet — plus an extra ${METAMASK_POINTS} Points as a bonus for migrating my MetaMask wallet into Rainbow` + `I just had ${ + ONBOARDING_TOTAL_POINTS - METAMASK_POINTS + } Rainbow Points dropped into my wallet — plus an extra ${METAMASK_POINTS} Points as a bonus for migrating my MetaMask wallet into Rainbow` ); text += `🦊${encodeURIComponent(' ')}🔫`; text += encodeURIComponent('\n\n'); From 9f103288a8b72b7de9264f5df278884444012c4f Mon Sep 17 00:00:00 2001 From: Ben Goldberg Date: Fri, 8 Dec 2023 15:25:17 -0800 Subject: [PATCH 09/10] fix console animation + hide mm row if 0 --- .../points/content/console/calculate.tsx | 53 ++++++++++++------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/src/screens/points/content/console/calculate.tsx b/src/screens/points/content/console/calculate.tsx index c68e12f9910..9d40b8b3c08 100644 --- a/src/screens/points/content/console/calculate.tsx +++ b/src/screens/points/content/console/calculate.tsx @@ -36,6 +36,9 @@ export const Calculate = () => { const { accountENS, accountAddress } = useAccountProfile(); const [isCalculationComplete, setIsCalculationComplete] = useState(false); + const [shouldShowContinueButton, setShouldShowContinueButton] = useState( + false + ); const accountName = (abbreviateEnsForDisplay(accountENS, 10) || formatAddress(accountAddress, 4, 5)) as string; @@ -132,24 +135,30 @@ export const Calculate = () => { typingSpeed={100} /> - - - - + {metamaskSwaps?.data?.usd_amount ? ( + + + + + ) : ( + <> + )} { textContent={( profile?.onboardPoints?.user.onboarding?.earnings?.total ?? 0 ).toLocaleString('en-US')} + onComplete={() => { + setShouldShowContinueButton(true); + }} typingSpeed={100} /> @@ -202,7 +214,7 @@ export const Calculate = () => { @@ -277,6 +289,7 @@ export const Calculate = () => { delayStart={1000} onComplete={() => { setIsCalculationComplete(true); + setShouldShowContinueButton(true); }} weight="normal" multiline @@ -284,7 +297,7 @@ export const Calculate = () => { /> From 3463e78d7b94d895b5e48613a424cdef694c9565 Mon Sep 17 00:00:00 2001 From: Ben Goldberg Date: Fri, 8 Dec 2023 15:38:28 -0800 Subject: [PATCH 10/10] console button animation delay --- src/screens/points/content/console/calculate.tsx | 12 +++++++++--- src/screens/points/content/console/review.tsx | 7 ++++++- src/screens/points/content/console/share.tsx | 5 ++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/screens/points/content/console/calculate.tsx b/src/screens/points/content/console/calculate.tsx index 9d40b8b3c08..0d9f9d2bf1e 100644 --- a/src/screens/points/content/console/calculate.tsx +++ b/src/screens/points/content/console/calculate.tsx @@ -171,7 +171,10 @@ export const Calculate = () => { delayStart={1000} enableHapticTyping onComplete={() => { - setIsCalculationComplete(true); + const complete = setTimeout(() => { + setIsCalculationComplete(true); + }, 500); + return () => clearTimeout(complete); }} textAlign="right" textContent={`+ ${bonus?.earnings?.total}`} @@ -288,8 +291,11 @@ export const Calculate = () => { color={textColors.gray} delayStart={1000} onComplete={() => { - setIsCalculationComplete(true); - setShouldShowContinueButton(true); + const complete = setTimeout(() => { + setIsCalculationComplete(true); + setShouldShowContinueButton(true); + }, 500); + return () => clearTimeout(complete); }} weight="normal" multiline diff --git a/src/screens/points/content/console/review.tsx b/src/screens/points/content/console/review.tsx index 1590e0a2378..b0423f31a29 100644 --- a/src/screens/points/content/console/review.tsx +++ b/src/screens/points/content/console/review.tsx @@ -92,7 +92,12 @@ export const Review = () => { /> setShowDoneButton(true)} + onComplete={() => { + const complete = setTimeout(() => { + setShowDoneButton(true); + }, 500); + return () => clearTimeout(complete); + }} textContent={i18n.t( i18n.l.points.console.share_bonus_paragraph_three )} diff --git a/src/screens/points/content/console/share.tsx b/src/screens/points/content/console/share.tsx index e747707b1c0..48a390a88f1 100644 --- a/src/screens/points/content/console/share.tsx +++ b/src/screens/points/content/console/share.tsx @@ -68,7 +68,10 @@ export const Share = () => { color={textColors.account} delayStart={1000} onComplete={() => { - setShowShareButtons(true); + const complete = setTimeout(() => { + setShowShareButtons(true); + }, 500); + return () => clearTimeout(complete); }} weight="normal" multiline