From d0fbd4fa8131b9253e5cbaf767c7c0874dfb2e5d Mon Sep 17 00:00:00 2001 From: youngkidwarrior Date: Mon, 21 Oct 2024 01:07:56 -0700 Subject: [PATCH] Better styles for small screens and errors in rewards --- .../app/components/MobileButtonRowLayout.tsx | 25 ++++++++------- .../__snapshots__/screen.test.tsx.snap | 4 +-- .../account/rewards/activity/screen.tsx | 31 ++++++++++++------- .../components/DistributionClaimButton.tsx | 10 +++--- 4 files changed, 38 insertions(+), 32 deletions(-) diff --git a/packages/app/components/MobileButtonRowLayout.tsx b/packages/app/components/MobileButtonRowLayout.tsx index be745deb3..6b3940642 100644 --- a/packages/app/components/MobileButtonRowLayout.tsx +++ b/packages/app/components/MobileButtonRowLayout.tsx @@ -190,13 +190,13 @@ export const ActivityRewards = ({ children, ...props }: XStackProps) => { {!isLoading && isVisible && direction !== 'down' && ( { ? `Total ${distributionMonth} Rewards` : `Estimated ${distributionMonth} Rewards`} - - {shareAmount === undefined ? '' : `${formatAmount(shareAmount, 10, 0)} SEND`} - - + + + + {shareAmount === undefined ? '' : `${formatAmount(shareAmount, 10, 0)} SEND`} + diff --git a/packages/app/features/account/rewards/activity/__snapshots__/screen.test.tsx.snap b/packages/app/features/account/rewards/activity/__snapshots__/screen.test.tsx.snap index cad0489de..4e09c9fd5 100644 --- a/packages/app/features/account/rewards/activity/__snapshots__/screen.test.tsx.snap +++ b/packages/app/features/account/rewards/activity/__snapshots__/screen.test.tsx.snap @@ -911,9 +911,9 @@ exports[`ActivityRewardsScreen renders: ActivityRewardsScreen 1`] = ` { "color": "#FFFFFF", "fontFamily": "System", - "fontSize": 13.2, + "fontSize": 15.6, "fontWeight": "300", - "lineHeight": 16, + "lineHeight": 18, "marginLeft": "auto", "marginRight": "auto", "userSelect": "auto", diff --git a/packages/app/features/account/rewards/activity/screen.tsx b/packages/app/features/account/rewards/activity/screen.tsx index a43bc2301..db4673fed 100644 --- a/packages/app/features/account/rewards/activity/screen.tsx +++ b/packages/app/features/account/rewards/activity/screen.tsx @@ -218,10 +218,7 @@ export function ActivityRewardsScreen() { - + )} @@ -480,12 +477,16 @@ const PerkCard = ({ const MultiplierCards = ({ distribution, - distributionDate, }: { distribution: UseDistributionsResultData[number] - distributionDate?: string }) => { const multipliers = distribution.distribution_verifications_summary[0]?.multipliers + const distributionMonth = distribution.timezone_adjusted_qualification_end.toLocaleString( + 'default', + { + month: 'long', + } + ) return ( @@ -497,12 +498,10 @@ const MultiplierCards = ({ .filter(([verificationType]) => multipliers?.[verificationType].multiplier_step > 0) .map(([verificationType, title]) => ( - +

- {verificationType === 'tag_referral' - ? distributionDate?.split(' ')[0] ?? 'Monthly' - : ''}{' '} + {verificationType === 'tag_referral' ? distributionMonth ?? 'Monthly' : ''}{' '} {title}

@@ -511,6 +510,7 @@ const MultiplierCards = ({ $sm={{ fontSize: '$8' }} fontWeight={'600'} color={'$color12'} + mx="auto" > X {multipliers?.[verificationType].value ?? 1} @@ -532,7 +532,14 @@ const MultiplierCard = ({ children }: PropsWithChildren) => { mih={112} w={'fit-content'} > - + {children} @@ -555,7 +562,7 @@ const ClaimableRewardsCard = ({ ) return ( - +

{isQualificationOver ? `Total ${distributionMonth}` : `Estimated ${distributionMonth}`}

diff --git a/packages/app/features/account/rewards/components/DistributionClaimButton.tsx b/packages/app/features/account/rewards/components/DistributionClaimButton.tsx index a86789cd1..d29cefd7a 100644 --- a/packages/app/features/account/rewards/components/DistributionClaimButton.tsx +++ b/packages/app/features/account/rewards/components/DistributionClaimButton.tsx @@ -200,7 +200,7 @@ export const DistributionClaimButton = ({ distribution }: DistributionsClaimButt // If the user is eligible but has already claimed, show the claim button disabled if (isClaimed) { return ( - + Claimed ) @@ -209,7 +209,7 @@ export const DistributionClaimButton = ({ distribution }: DistributionsClaimButt return (