Skip to content

Commit

Permalink
update hourly reward
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmegalodon committed Feb 1, 2024
1 parent ac1bb58 commit 1fdcf5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/modules/PublicSale/hourlyReward/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,12 @@ const HourlyReward = () => {
return (REWARDS[currentDay.diffDay] as number) / 24;
}, [currentDay, REWARDS])

return null;
return (
<Flex className={s.container}>
<Flex justifyContent={"space-between"} alignItems={"center"}>
<Flex justifyContent={"space-between"} alignItems={"center"} gap={"6px"}>
<Text className={s.title}>Hourly Reward</Text>
<Flex className={s.timeWrapper}>
<Text className={s.time}>{formatCurrency(currentHourReward, MIN_DECIMAL, MIN_DECIMAL, 'BTC', false)} BVM</Text>
<Text className={s.time}>{formatCurrency(currentHourReward, 0, 0, 'BTC', false)} BVM</Text>
</Flex>
</Flex>
<HourlyRewardButton />
Expand Down
12 changes: 6 additions & 6 deletions src/modules/PublicSale/hourlyRewardButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ const HourlyRewardButton = ({ className }: any) => {
const [isEnd, setIsEnd] = React.useState(false);

const hourlyEndTime = useMemo(() => {
const res = dayjs.utc().set('minute', 30);
if (dayjs().utc().isBefore(res)) {
console.log('fadfa', res.get('hour'));
res.set('hour', res.get('hour') + 1);
let res = dayjs.utc().set('minute', 30);
res = res.set('second', 0);
if (dayjs().utc().isAfter(res)) {
res = res.set('hour', res.get('hour') + 1);
}
if(isEnd) {
setIsEnd(false);
Expand All @@ -21,8 +21,8 @@ const HourlyRewardButton = ({ className }: any) => {
return res.toString();
}, [isEnd]);

console.log('dayjs.utc()', dayjs.utc().toString());
console.log('hourlyEndTime', hourlyEndTime);
// console.log('dayjs.utc()', dayjs.utc().toString());
// console.log('hourlyEndTime', hourlyEndTime);

return (
<Flex className={cx(s.container, className)}>
Expand Down

0 comments on commit 1fdcf5b

Please sign in to comment.