Skip to content

Commit

Permalink
update condition
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmegalodon committed Feb 1, 2024
1 parent 9b4ffeb commit 37d420f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/modules/PublicSale/hourlyRewardButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ const HourlyRewardButton = ({ className }: any) => {
return `Congrats! You Have Earned`;
} else if (Number(dailyReward?.pending) > 0) {
return `Your Estimated Reward`;
} else if (!dailyReward) {
} else if (rewardValue === 0) {
return `Contribute early & earn extra $BVM`;
}
return `Today's Total Reward`;
}, [rewardValue, dailyReward]);

const isBuy = useMemo(() => {
return !!dailyReward;
}, [dailyReward]);
const needBuy = useMemo(() => {
return rewardValue === 0 && Number(dailyReward?.pending || "0") === 0;
}, [rewardValue, dailyReward]);

const generateLinkTweet = async () => {
let code = '';
Expand Down Expand Up @@ -268,22 +268,22 @@ const HourlyRewardButton = ({ className }: any) => {
</Flex>
<Flex className={s.bottomWrapper} direction={"column"}>
<Text
className={cx(s.text_text, !isBuy && s.notBuy)}
className={cx(s.text_text, needBuy && s.notBuy)}
>
{titleReward}
</Text>

{
isBuy && (
!needBuy && (
<Flex gap={'6px'} className={s.timeWrapper}>
<Text className={cx(s.rewardValue, rewardValue > 0 ? s.claimable : '')}>{formatCurrency(rewardValue || dailyReward?.pending || currentDayReward, MIN_DECIMAL, MIN_DECIMAL, 'BTC', false)} BVM</Text>
<Text className={cx(s.rewardValue, s.claimable)}>{formatCurrency(rewardValue || dailyReward?.pending, MIN_DECIMAL, MIN_DECIMAL, 'BTC', false)} BVM</Text>
</Flex>
)
}
<Flex gap={4} w={"100%"}>
<>
{
isBuy ? (
!needBuy ? (
<Flex
className={cx(s.learnMoreWrapper)}
gap={2}
Expand Down

0 comments on commit 37d420f

Please sign in to comment.