Skip to content

Commit

Permalink
Add dynamic redacted banner logic to show/hide
Browse files Browse the repository at this point in the history
  • Loading branch information
calebjacob committed Sep 21, 2024
1 parent e2e3b14 commit 063b11e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
Binary file added public/images/redacted/redacted-right-empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 18 additions & 6 deletions src/components/RedactedBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ import { Container } from '@near-pagoda/ui';
import s from './RedactedBanner.module.scss';

export const RedactedBanner = () => {
const now = Date.now();
const redactedEndTime = 1731139200000; // Nov 9th 2024
const hackathonEndTime = 1727247600000; // Oct 25th 2024
const hackathonEndPassed = now > hackathonEndTime;
const redactedEndPassed = now > redactedEndTime;

if (redactedEndPassed) return null;

return (
<Container>
<div className={s.redactedBanner}>
Expand All @@ -13,12 +21,16 @@ export const RedactedBanner = () => {
/>
</a>

<a href="https://redacted.devpost.com/" target="_blank">
<img
src="/images/redacted/redacted-right.png"
alt="Redacted: It's so much more than a hackathon. Click to learn more"
/>
</a>
{hackathonEndPassed ? (
<img src="/images/redacted/redacted-right-empty.png" alt="Redacted" />
) : (
<a href="https://redacted.devpost.com/" target="_blank">
<img
src="/images/redacted/redacted-right.png"
alt="Redacted: It's so much more than a hackathon. Click to learn more"
/>
</a>
)}
</div>
</Container>
);
Expand Down

0 comments on commit 063b11e

Please sign in to comment.