Skip to content

Commit

Permalink
Add committee application alert to frontpage
Browse files Browse the repository at this point in the history
  • Loading branch information
jotjern committed Jan 21, 2025
1 parent 9773372 commit ba6b11f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/frontpage/components/Alert/alert.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.alert {
margin-bottom: 40px;
background-color: #ffffcc;

Check failure on line 3 in src/frontpage/components/Alert/alert.less

View workflow job for this annotation

GitHub Actions / stylelint

src/frontpage/components/Alert/alert.less#L3

Expected "#ffffcc" to be "#ffc" (color-hex-length)
border: 3px solid #ffcc00;

Check failure on line 4 in src/frontpage/components/Alert/alert.less

View workflow job for this annotation

GitHub Actions / stylelint

src/frontpage/components/Alert/alert.less#L4

Expected "#ffcc00" to be "#fc0" (color-hex-length)
border-radius: 5px;
padding: 10px;
font-size: 1.3rem;
}

.alert a {
text-decoration: underline;
}

.alert a:hover {
text-decoration: none;
}
12 changes: 12 additions & 0 deletions src/frontpage/components/Alert/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React, { FC, ReactNode } from 'react';
import styles from './alert.less';

const Alert: FC<{ children: ReactNode; validUntil: Date }> = ({ children, validUntil }) => {
if (new Date() > validUntil) {
return null;
}

return <div className={styles.alert}>{children}</div>;
};

export default Alert;
7 changes: 7 additions & 0 deletions src/frontpage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ import Articles from './components/Articles';
import ForCompanies from './components/ForCompanies';
import Offline from './components/Offline';
import { IOfflineIssue } from './models/Offline';
import Alert from './components/Alert';

interface FrontpageProps {
offlines: IOfflineIssue[];
}

const Frontpage: FC<FrontpageProps> = ({ offlines }) => (
<>
<Alert validUntil={new Date('2025-01-27')}>
<p>
Opptak til Velkom, Backlog, Ekskom, Jubkom og Karrieredagene har nå åpnet! Les mer på{' '}
<a href="https://opptak.online.ntnu.no/">opptakssiden</a>
</p>
</Alert>
<EventsContainer />
<Registrations />
<Articles />
Expand Down

0 comments on commit ba6b11f

Please sign in to comment.