diff --git a/js/components/app.tsx b/js/components/app.tsx index 47919b2c..82d57245 100644 --- a/js/components/app.tsx +++ b/js/components/app.tsx @@ -1,4 +1,5 @@ import { reload } from "../browser"; +import { DataWarningsProvider } from "../contexts/dataWarningsContext"; import { SocketProvider } from "../contexts/socketContext"; import { ORBIT_BL_FFD, @@ -9,6 +10,7 @@ import { } from "../groups"; import { paths } from "../paths"; import { AppcuesTrackPage } from "./appcues"; +import { Banner } from "./banner"; import { Header } from "./header"; import { LadderPage } from "./ladderPage/ladderPage"; import { LandingPage } from "./landingPage"; @@ -78,11 +80,16 @@ const router = createBrowserRouter([ { errorElement: , element: ( - <> + -
- - +
+
+ +
+
+ +
+ ), children: [ { diff --git a/js/components/banner.tsx b/js/components/banner.tsx new file mode 100644 index 00000000..05476ccd --- /dev/null +++ b/js/components/banner.tsx @@ -0,0 +1,27 @@ +import { useDataWarnings } from "../contexts/dataWarningsContext"; +import { className } from "../util/dom"; +import { ReactElement } from "react"; + +export const Banner = (): ReactElement => { + const [warnings] = useDataWarnings(); + + return warnings.size > 0 ? +
+
+ + + +

+ Data Issue +

+
+
+
    + {[...warnings].map((warning) => { + return
  • Train positions out of date
  • ; + })} +
+
+
+ : <>; +}; diff --git a/js/components/header.tsx b/js/components/header.tsx index 688bf3b7..b4a3bb09 100644 --- a/js/components/header.tsx +++ b/js/components/header.tsx @@ -9,7 +9,7 @@ export const Header = () => { currentLocation.pathname === paths.help; return ( -
+
MBTA diff --git a/js/components/ladderPage/ladderPage.tsx b/js/components/ladderPage/ladderPage.tsx index 7be5a76b..fa4e9f04 100644 --- a/js/components/ladderPage/ladderPage.tsx +++ b/js/components/ladderPage/ladderPage.tsx @@ -44,11 +44,13 @@ export const LadderPage = ({ routeId }: { routeId: RouteId }): ReactElement => { }, [onEscape]); return ( -
+
+ {sideBarSelection !== null ? + + : null}
{ sideBarSelection={sideBarSelection} />
- {sideBarSelection !== null ? - - : null}
); }; diff --git a/js/components/ladderPage/sidebar.tsx b/js/components/ladderPage/sidebar.tsx index b235d62a..84c97ebf 100644 --- a/js/components/ladderPage/sidebar.tsx +++ b/js/components/ladderPage/sidebar.tsx @@ -27,14 +27,14 @@ export const SideBar = ({ close: () => void; }): ReactElement => { return ( -