Skip to content

Commit

Permalink
Merge pull request #78 from near/feat/redacted-banner
Browse files Browse the repository at this point in the history
Redacted banner on all pages
  • Loading branch information
calebjacob authored Sep 21, 2024
2 parents 5eb82aa + 063b11e commit 84a4a54
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 0 deletions.
Binary file added public/images/redacted/redacted-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
Binary file added public/images/redacted/redacted-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions src/components/RedactedBanner.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.redactedBanner {
display: grid;
grid-template-columns: 1fr 1fr;

a {
display: block;
outline: none;
transition: box-shadow 300ms;
position: relative;

&::before {
content: '';
display: block;
position: absolute;
inset: 0;
transition: box-shadow 300ms;
}

&:hover {
z-index: 100;
box-shadow: 0 0 1rem rgba(0, 0, 0, 0.3);
}

&:focus-visible {
z-index: 100;
&::before {
box-shadow: inset 0 0 0 4px var(--violet5);
}
}

img {
width: 100%;
}
}
}
37 changes: 37 additions & 0 deletions src/components/RedactedBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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}>
<a href="https://airtable.com/appdLXQkwmt4rqtW0/pag21sUeq3cAW994V/form" target="_blank">
<img
src="/images/redacted/redacted-left.png"
alt="Redacted: Reclaim your sovereignty at no cost. Click to be there IRL"
/>
</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>
);
};
2 changes: 2 additions & 0 deletions src/components/layouts/DefaultLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { type ReactNode } from 'react';

import { Footer } from '../Footer';
import { Navigation } from '../navigation/Navigation';
import { RedactedBanner } from '../RedactedBanner';
import s from './DefaultLayout.module.scss';

interface Props {
Expand All @@ -14,6 +15,7 @@ export function DefaultLayout({ children }: Props) {
<Navigation />

<div className={s.content}>
<RedactedBanner />
{children}
<Footer />
</div>
Expand Down

0 comments on commit 84a4a54

Please sign in to comment.