From aaa6b6e25f54ef57d37ad5c0ca2a1d55a5d80613 Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Thu, 4 Jan 2024 22:16:15 +0700 Subject: [PATCH] chore: adjust logic for displaying sidebar cards --- .../creators/CreatorDashboardSidebar.tsx | 20 ++++--------------- .../cards/CreatorInfoCard.module.sass | 3 +-- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/components/creators/CreatorDashboardSidebar.tsx b/src/components/creators/CreatorDashboardSidebar.tsx index fc04a2d2f..66b5ebd3f 100644 --- a/src/components/creators/CreatorDashboardSidebar.tsx +++ b/src/components/creators/CreatorDashboardSidebar.tsx @@ -7,7 +7,6 @@ import { useFetchTotalStake } from 'src/rtk/features/creators/totalStakeHooks' import { useMyAddress } from '../auth/MyAccountsContext' import CreatePostCard from './cards/CreatePostCard' import CreatorInfoCard from './cards/CreatorInfoCard' -import GetMoreSubCard from './cards/GetMoreSubCard' import MyStakeCard from './cards/MyStakeCard' import StakerRewardInfoCard from './cards/StakerRewardInfoCard' import StakeSubCard from './cards/StakeSubCard' @@ -79,7 +78,8 @@ function SpacePageSidebar({ space }: Extract {(() => { - if (!isCreatorSpace) return + if (!isCreatorSpace && !totalStake?.hasStaked) return + if (stakeData?.hasStaked) return else return })()} @@ -91,27 +91,15 @@ function SpacePageSidebar({ space }: Extract) { const myAddress = useMyAddress() ?? '' const { data, loading: loadingTotalStake } = useFetchTotalStake(myAddress) - const { isCreatorSpace, loading: loadingCreator } = useIsCreatorSpace(space.id) + const { loading: loadingCreator } = useIsCreatorSpace(space.id) if (loadingCreator) { return null } - if (!isCreatorSpace) { - return ( - <> - - - - ) - } - return ( <> - {(() => { - if (!isCreatorSpace) return - return - })()} + {!loadingTotalStake && (data?.hasStaked ? : )} diff --git a/src/components/creators/cards/CreatorInfoCard.module.sass b/src/components/creators/cards/CreatorInfoCard.module.sass index 30dd31ce5..a3ddee054 100644 --- a/src/components/creators/cards/CreatorInfoCard.module.sass +++ b/src/components/creators/cards/CreatorInfoCard.module.sass @@ -13,10 +13,9 @@ margin-bottom: $space_small .Title - font-size: $font_large + font-size: $font_semilarge font-weight: $font_weight_semibold line-height: normal - margin-bottom: $space_mini .Subtitle opacity: 0.8