Skip to content

Commit

Permalink
feat: open source contribution notification
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyle56 committed Mar 2, 2024
1 parent 1dc256e commit 487a0d7
Showing 1 changed file with 30 additions and 15 deletions.
45 changes: 30 additions & 15 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,49 @@ const App = () => {

const degree = useSelector((state: RootState) => state.degree);

// temporary subcommittee recruitment drive notification
// TODO: either remove or productionise this later
useEffect(() => {
// using local storage since I don't want to risk invalidating the redux state right now
const cooldownMs = 1000 * 60 * 60 * 23; // every 23 hours
const lastSeen = localStorage.getItem('last-seen-recruitment');
if (lastSeen !== null && Date.now() - parseInt(lastSeen, 10) < cooldownMs) {
return;
}
const cooldownMs = 1000 * 60 * 60 * 24 * 7; // every 7 days
const lastSeen = localStorage.getItem('last-seen-contribution');
if (lastSeen !== null && Date.now() - parseInt(lastSeen, 10) < cooldownMs) return;

localStorage.setItem('last-seen-recruitment', Date.now().toString());
localStorage.setItem('last-seen-contribution', Date.now().toString());

openNotification({
type: 'info',
message: 'Subcommittee Recruitment!',
message: 'Want to contribute?',
description: (
<>
Interested in working on Circles or one of our other student-led projects? DevSoc is
currently recruiting members for our 2024 subcommittee!
Found a bug or have feedback? Open an issue on{' '}
<a
href="https://github.com/devsoc-unsw/circles/issues"
target="_blank"
rel="noopener noreferrer"
>
GitHub
</a>{' '}
or share your thoughts on{' '}
<a href="https://discord.gg/u9p34WUTcs" target="_blank" rel="noopener noreferrer">
Discord
</a>
!
<br />
<br />
Find out more at{' '}
<a href="https://devsoc.app/get-involved" target="_blank" rel="noopener noreferrer">
devsoc.app/get-involved
Feeling brave? You can even fix it yourself by submitting a{' '}
<a
href="https://github.com/devsoc-unsw/circles/pulls"
target="_blank"
rel="noopener noreferrer"
>
pull request
</a>
!
<br />
<br />
Let&apos;s make <strong>Circles</strong> even better, together! &#128156;
</>
),
duration: 0,
duration: 20,
icon: <SmileOutlined style={{ color: lightTheme.purplePrimary }} />
});
}, []);
Expand Down

0 comments on commit 487a0d7

Please sign in to comment.