From 1a497e67d175bedc5f603d44e7455ebd38193133 Mon Sep 17 00:00:00 2001 From: Marcin Ciarka Date: Tue, 16 Jul 2024 12:41:25 +0200 Subject: [PATCH] chore: Refactor RaysCountSmall component to handle userAddress conditionally and display if user isnt connected --- .../RaysCountSmall/RaysCountSmall.tsx | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/app-ui/src/components/molecules/RaysCountSmall/RaysCountSmall.tsx b/packages/app-ui/src/components/molecules/RaysCountSmall/RaysCountSmall.tsx index 10da752a0f..b58830ca0c 100644 --- a/packages/app-ui/src/components/molecules/RaysCountSmall/RaysCountSmall.tsx +++ b/packages/app-ui/src/components/molecules/RaysCountSmall/RaysCountSmall.tsx @@ -48,26 +48,30 @@ export const RaysCountSmall = ({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [userAddress]) - if (!userAddress) { - return null - } - return (
- {loadingRaysCount || raysCount === null ? ( + {loadingRaysCount ? ( ) : ( - <>{formatter(new BigNumber(raysCount)).split('.')[0]} Rays + <> + {raysCount + ? `${formatter(new BigNumber(raysCount)).split('.')[0]} Rays` + : 'Get $RAYS'} + )}