Skip to content

Commit

Permalink
feat: add tooltip for reward earned
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Jan 17, 2024
1 parent a40ca9b commit 7fc1256
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions src/components/posts/view-post/PostRewardStat.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Tooltip } from 'antd'
import clsx from 'clsx'
import { ComponentProps } from 'react'
import { TbCoins } from 'react-icons/tb'
Expand All @@ -11,22 +12,24 @@ export default function PostRewardStat({ postId, ...props }: PostRewardStatProps
if (!reward?.isNotZero) return null

return (
<div
{...props}
className={clsx('d-flex align-items-center GapMini FontWeightMedium', props.className)}
>
<TbCoins className='FontNormal' />
<span className='FontWeightSemibold'>
<FormatBalance
style={{ whiteSpace: 'nowrap' }}
currency='SUB'
decimals={10}
precision={2}
withMutedDecimals={false}
value={reward.amount}
/>
</span>
<span className='d-flex align-items-center GapMini ColorMuted'>earned</span>
<div {...props} className={clsx(props.className)}>
<Tooltip
className='d-flex align-items-center GapMini FontWeightMedium'
title='Rewards earned depend on how many likes a post or comment gets, and how much SUB each liker has staked'
>
<TbCoins className='FontNormal' />
<span className='FontWeightSemibold'>
<FormatBalance
style={{ whiteSpace: 'nowrap' }}
currency='SUB'
decimals={10}
precision={2}
withMutedDecimals={false}
value={reward.amount}
/>
</span>
<span className='d-flex align-items-center GapMini ColorMuted'>earned</span>
</Tooltip>
</div>
)
}

0 comments on commit 7fc1256

Please sign in to comment.