Skip to content

Commit

Permalink
Add LA fire warning (#2320)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanapotski authored Jan 16, 2025
1 parent 6da2319 commit a2664d2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
File renamed without changes.
38 changes: 29 additions & 9 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect } from "react";
import { CssBaseline } from "@mui/material";
import { useEffect, useState } from "react";
import { CssBaseline, Alert, Snackbar, Stack } from "@mui/material";
import SurveySnackbar from "./components/UI/SurveySnackbar";
import { SiteProvider } from "./contexts/siteContext";
import { ToasterProvider } from "contexts/toasterContext";
Expand All @@ -21,13 +21,6 @@ function App() {
analytics.postEvent("visitAppComponent");
}, []);

// const [snackbarOpen, setSnackbarOpen] = useState(false);
// const [snackbarMessage, setSnackbarMessage] = useState("");

// const handleCloseSnackbar = () => {
// setSnackbarOpen(false);
// };

return (
<HelmetProvider>
<CssBaseline />
Expand All @@ -43,6 +36,8 @@ function App() {
/>
<MapProvider>
<Router>
<LAFireWarning />

<AppRoutes />
{hasUserFeedbackSuveyFeatureFlag && <SurveySnackbar />}
</Router>
Expand All @@ -57,3 +52,28 @@ function App() {
}

export default App;

function LAFireWarning() {
const [snackbarOpen, setSnackbarOpen] = useState(true);

return (
<Stack spacing={2} sx={{ maxWidth: 700 }}>
<Snackbar
open={snackbarOpen}
onClose={() => setSnackbarOpen(false)}
anchorOrigin={{
vertical: "bottom",
horizontal: "right",
}}
>
<Alert
onClose={() => setSnackbarOpen(false)}
severity="warning"
sx={{ width: "100%" }}
>
Due to the LA Fires (Jan 2025), some information may be out-of-date.
</Alert>
</Snackbar>
</Stack>
);
}

0 comments on commit a2664d2

Please sign in to comment.