Skip to content

Commit 34ee3ee

Browse files
authored
feat: Add banner to the Urban dashboard (#258)
2 parents 5a66e1d + 9ae7957 commit 34ee3ee

File tree

3 files changed

+62
-15
lines changed

3 files changed

+62
-15
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.uswds-banner {
2+
width: 100%;
3+
background-color: #22229B;
4+
padding: 10px 0;
5+
z-index: 9999;
6+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
7+
flex-shrink: 0;
8+
}
9+
10+
.uswds-banner-inner {
11+
max-width: 1040px;
12+
margin: 0 auto;
13+
padding: 0 1rem;
14+
display: flex;
15+
align-items: center;
16+
}
17+
18+
.uswds-banner-flag {
19+
height: 16px;
20+
width: auto;
21+
margin-right: 0.75rem;
22+
}
23+
24+
.uswds-banner-text {
25+
font-size: 0.875rem; /* 14px */
26+
color: #ffffff;
27+
margin: 0;
28+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
import './index.css';
3+
4+
export function Banner({ text }) {
5+
return (
6+
<div className="uswds-banner">
7+
<div className="uswds-banner-inner">
8+
<p className="uswds-banner-text">{text}</p>
9+
</div>
10+
</div>
11+
);
12+
}

urban-dashboard/src/components/dashboard/index.jsx

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import Box from '@mui/material/Box';
33

44
import { MapBoxViewer } from '../mapboxViewer';
55
import { InfoSidebar } from '../infoSidebar';
6+
import { Banner } from '../banner';
7+
8+
const BANNER_TEXT = "Due to the lapse in federal government funding, the U.S. Greenhouse Gas Center is not updating this website. We sincerely regret this inconvenience.";
69

710
export function Dashboard({ dataset, urbanRegions }) {
811
const [urbanRegion, setUrbanRegion] = useState("");
@@ -14,21 +17,25 @@ export function Dashboard({ dataset, urbanRegions }) {
1417

1518
return (
1619
<Box
17-
className="fullSize">
18-
<InfoSidebar
19-
urbanRegions={urbanRegions}
20-
selection={urbanRegion}
21-
setSelection={setUrbanRegion}
22-
handleZoomOut={handleZoomOut}
23-
dataset={dataset}
24-
/>
25-
<MapBoxViewer
26-
urbanRegions={urbanRegions}
27-
urbanRegion={urbanRegion}
28-
setSelection={setUrbanRegion}
29-
zoomOut={zoomOut}
30-
dataset={dataset}
31-
/>
20+
className="fullSize"
21+
sx={{ display: 'flex', flexDirection: 'column' }}>
22+
<Banner text={BANNER_TEXT} />
23+
<Box sx={{ flex: 1, position: 'relative', minHeight: 0 }}>
24+
<InfoSidebar
25+
urbanRegions={urbanRegions}
26+
selection={urbanRegion}
27+
setSelection={setUrbanRegion}
28+
handleZoomOut={handleZoomOut}
29+
dataset={dataset}
30+
/>
31+
<MapBoxViewer
32+
urbanRegions={urbanRegions}
33+
urbanRegion={urbanRegion}
34+
setSelection={setUrbanRegion}
35+
zoomOut={zoomOut}
36+
dataset={dataset}
37+
/>
38+
</Box>
3239
</Box>
3340
);
3441
}

0 commit comments

Comments
 (0)