Skip to content

Commit

Permalink
Merge pull request #164 from dappforce/improvement/creator-reward
Browse files Browse the repository at this point in the history
Show Creator Reward Card Everytime
  • Loading branch information
olehmell authored Jan 11, 2024
2 parents 6c8840a + 8923bd3 commit 17e8b75
Showing 1 changed file with 18 additions and 23 deletions.
41 changes: 18 additions & 23 deletions src/components/creators/CreatorDashboardSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,20 @@ function HomePageSidebar({ variant }: Extract<CreatorDashboardSidebarType, { nam
const { data, loading } = useFetchTotalStake(myAddress)

if (loading) return null
if (data?.hasStaked)
return (
<>
<CreatePostCard variant={variant} />
<StakerRewardInfoCard />
<CreatorRewardInfoCard />
</>
)
return <SupportCreatorsCard />

return (
<>
{data?.hasStaked ? (
<>
<CreatePostCard variant={variant} />
<StakerRewardInfoCard />
</>
) : (
<SupportCreatorsCard />
)}
<CreatorRewardInfoCard />
</>
)
}

function SpacePageSidebar({ space }: Extract<CreatorDashboardSidebarType, { name: 'space-page' }>) {
Expand All @@ -84,12 +89,8 @@ function SpacePageSidebar({ space }: Extract<CreatorDashboardSidebarType, { name
return (
<>
{renderTopCard()}
{!loadingTotalStake && totalStake?.hasStaked && (
<>
<StakerRewardInfoCard />
<CreatorRewardInfoCard />
</>
)}
{!loadingTotalStake && totalStake?.hasStaked && <StakerRewardInfoCard />}
<CreatorRewardInfoCard />
</>
)
}
Expand All @@ -107,14 +108,8 @@ function PostPageSidebar({ space }: Extract<CreatorDashboardSidebarType, { name:
<>
<CreatorInfoCard showStakeButton={data?.hasStaked} space={space} />
{!loadingTotalStake &&
(data?.hasStaked ? (
<>
<StakerRewardInfoCard />
<CreatorRewardInfoCard />
</>
) : (
<StakeSubCard space={space} />
))}
(data?.hasStaked ? <StakerRewardInfoCard /> : <StakeSubCard space={space} />)}
<CreatorRewardInfoCard />
</>
)
}

0 comments on commit 17e8b75

Please sign in to comment.