Skip to content

Commit

Permalink
Update timeline header detail airdrop
Browse files Browse the repository at this point in the history
  • Loading branch information
anhnhu committed Jun 18, 2024
1 parent 9988c6d commit 2067cc5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ enum Timeline {
END = 'end'
}

function Component({ airdropInfo, className }: Props) {
function Component ({ airdropInfo, className }: Props) {
const { t } = useTranslation();

const { currentTimeline, pastTimelines } = (() => {
const { start, end, start_snapshot, end_snapshot, end_claim, start_claim } = airdropInfo;
const { start, end, start_snapshot, end_claim, start_claim } = airdropInfo;
const currentDate = Date.now();
const startMs = new Date(start).getTime();
const endMs = new Date(end).getTime();
const startSnapshotMs = new Date(start_snapshot).getTime();
const endSnapshotMs = new Date(end_snapshot).getTime();
// const endSnapshotMs = new Date(end_snapshot).getTime();
const endClaimMs = new Date(end_claim).getTime();
const startClaim = new Date(start_claim).getTime();

Expand All @@ -40,7 +40,7 @@ function Component({ airdropInfo, className }: Props) {
if (currentDate >= startMs && currentDate < startSnapshotMs) {
currentTimeline = Timeline.START;
pastTimelines.push(Timeline.START);
} else if (currentDate >= startSnapshotMs && currentDate <= endSnapshotMs) {
} else if (currentDate >= startSnapshotMs && currentDate <= startClaim) {
currentTimeline = Timeline.SNAPSHOT;
pastTimelines.push(Timeline.START, Timeline.SNAPSHOT);
} else if (currentDate >= startClaim && currentDate <= endClaimMs) {
Expand Down

0 comments on commit 2067cc5

Please sign in to comment.