Skip to content

Commit

Permalink
feat: hide creator rewards if no data for it
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Jan 26, 2024
1 parent 43612b2 commit d7307e5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/creators/rewards/RewardInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,17 @@ export default function RewardInfo({ size, ...props }: RewardInfoProps) {
)
}

const hasCreatorReward = (data?.receivedLikes ?? 0) > 0

return (
<div {...props} className={clsx(styles.RewardInfo, props.className)}>
<StakerRewardInfo rewardReport={data} size={size} loading={loading} />
<div className='pt-2 mt-2.5' style={{ borderTop: '1px solid #E2E8F0' }} />
<CreatorRewardInfo rewardReport={data} size={size} loading={loading} />
{hasCreatorReward && (
<>
<div className='pt-2 mt-2.5' style={{ borderTop: '1px solid #E2E8F0' }} />
<CreatorRewardInfo rewardReport={data} size={size} loading={loading} />
</>
)}
<div
className='mt-3'
style={{
Expand Down

0 comments on commit d7307e5

Please sign in to comment.