Skip to content

Commit

Permalink
refactor: remove unnecessary code style complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Jan 9, 2024
1 parent 0f0ae7e commit 25a8c3b
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions src/components/creators/CreatorDashboardSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,15 @@ function HomePageSidebar({ variant }: Extract<CreatorDashboardSidebarType, { nam
const myAddress = useMyAddress() ?? ''
const { data, loading } = useFetchTotalStake(myAddress)

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

function SpacePageSidebar({ space }: Extract<CreatorDashboardSidebarType, { name: 'space-page' }>) {
Expand Down

0 comments on commit 25a8c3b

Please sign in to comment.