Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions helpers/mint-visibility.helpers.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
import { isMintEligibleUtcDay } from "@/components/meme-calendar/meme-calendar.helpers";

function isMintingDayUtc(now: Date = new Date()): boolean {
return isMintEligibleUtcDay(now);
}

interface ShouldShowNextMintAfterEndParams {
readonly isMintEnded: boolean;
readonly nextMintExists: boolean;
readonly now?: Date;
}

export function shouldShowNextMintInLatestDrop({
isMintEnded,
nextMintExists,
now,
}: ShouldShowNextMintAfterEndParams): boolean {
if (!isMintEnded || !nextMintExists) return false;
return !isMintingDayUtc(now);
return isMintEnded && nextMintExists;
}

export function shouldShowNextWinnerInComingUp({
isMintEnded,
nextMintExists,
now,
}: ShouldShowNextMintAfterEndParams): boolean {
if (!nextMintExists) return false;
return !isMintEnded || isMintingDayUtc(now);
return !isMintEnded;
}
Loading