Skip to content

Commit ba6b11f

Browse files
committed
Add committee application alert to frontpage
1 parent 9773372 commit ba6b11f

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.alert {
2+
margin-bottom: 40px;
3+
background-color: #ffffcc;
4+
border: 3px solid #ffcc00;
5+
border-radius: 5px;
6+
padding: 10px;
7+
font-size: 1.3rem;
8+
}
9+
10+
.alert a {
11+
text-decoration: underline;
12+
}
13+
14+
.alert a:hover {
15+
text-decoration: none;
16+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React, { FC, ReactNode } from 'react';
2+
import styles from './alert.less';
3+
4+
const Alert: FC<{ children: ReactNode; validUntil: Date }> = ({ children, validUntil }) => {
5+
if (new Date() > validUntil) {
6+
return null;
7+
}
8+
9+
return <div className={styles.alert}>{children}</div>;
10+
};
11+
12+
export default Alert;

src/frontpage/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@ import Articles from './components/Articles';
55
import ForCompanies from './components/ForCompanies';
66
import Offline from './components/Offline';
77
import { IOfflineIssue } from './models/Offline';
8+
import Alert from './components/Alert';
89

910
interface FrontpageProps {
1011
offlines: IOfflineIssue[];
1112
}
1213

1314
const Frontpage: FC<FrontpageProps> = ({ offlines }) => (
1415
<>
16+
<Alert validUntil={new Date('2025-01-27')}>
17+
<p>
18+
Opptak til Velkom, Backlog, Ekskom, Jubkom og Karrieredagene har nå åpnet! Les mer på{' '}
19+
<a href="https://opptak.online.ntnu.no/">opptakssiden</a>
20+
</p>
21+
</Alert>
1522
<EventsContainer />
1623
<Registrations />
1724
<Articles />

0 commit comments

Comments
 (0)