-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add info banner * store banner state in cookie * rename Banner.tsx * update snapshots * update banner text * update banner * update snapshots
- Loading branch information
1 parent
c0af223
commit 5e4972d
Showing
14 changed files
with
1,001 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,9 @@ | |
#menu-lines { | ||
padding: 0 40px; | ||
} | ||
|
||
.Header__info-banner { | ||
padding-left: 0; | ||
padding-right: 0; | ||
max-width: 1200px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React, { useState } from 'react' | ||
import Alert from 'react-bootstrap/Alert' | ||
import './Header.css' | ||
import { Container } from 'react-bootstrap' | ||
import { set as setCookie, get as getCookie } from 'es-cookie' | ||
|
||
function InfoBanner(): JSX.Element | null { | ||
const initialState = getCookie('eblShowInfoBanner') !== 'false' | ||
const [show, setShow] = useState(initialState) | ||
|
||
const midnight = new Date() | ||
midnight.setHours(23, 59, 59) | ||
|
||
return show ? ( | ||
<Container fluid className="Header__info-banner"> | ||
<Alert | ||
variant="warning" | ||
onClose={() => { | ||
setShow(false) | ||
setCookie('eblShowInfoBanner', 'false', { expires: midnight }) | ||
}} | ||
dismissible | ||
> | ||
<strong>Scheduled Maintenance Notice:</strong> On{' '} | ||
<strong>Monday, July 15, 2024, from 10:00 AM to 12:00 PM CEST</strong>, | ||
the eBL servers will be undergoing scheduled maintenance. During this | ||
time, you will not be able to log in or make any changes to records. The | ||
maintenance may also cause temporary service interruptions. Registered | ||
users will receive an email notification once the maintenance is | ||
complete. | ||
</Alert> | ||
</Container> | ||
) : null | ||
} | ||
|
||
export default InfoBanner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.