diff --git a/common/components/charts/ChartPageDiv.tsx b/common/components/charts/ChartPageDiv.tsx new file mode 100644 index 000000000..c36afbee6 --- /dev/null +++ b/common/components/charts/ChartPageDiv.tsx @@ -0,0 +1,9 @@ +import React from 'react'; + +interface ChartPageDivProps { + children: React.ReactNode; +} + +export const ChartPageDiv: React.FC = ({ children }) => { + return
{children}
; +}; diff --git a/common/components/widgets/Widget.tsx b/common/components/widgets/Widget.tsx index a5fb57801..4456f4cb2 100644 --- a/common/components/widgets/Widget.tsx +++ b/common/components/widgets/Widget.tsx @@ -8,7 +8,7 @@ interface WidgetPageProps { export const WidgetPage: React.FC = ({ children }) => { return ( -
+
{children}
diff --git a/modules/dashboard/Overview.tsx b/modules/dashboard/Overview.tsx index de08a0bfb..d409c2b36 100644 --- a/modules/dashboard/Overview.tsx +++ b/modules/dashboard/Overview.tsx @@ -17,13 +17,11 @@ export function Overview() { const isHeavyRailLine = line ? HEAVY_RAIL_LINES.includes(line) : false; return ( -
-
- {tab === 'Subway' && } - {tab === 'Subway' && } - - {tab === 'Subway' && isHeavyRailLine && } -
+
+ {tab === 'Subway' && } + {tab === 'Subway' && } + + {tab === 'Subway' && isHeavyRailLine && }
); diff --git a/modules/ridership/RidershipDetails.tsx b/modules/ridership/RidershipDetails.tsx index b84cf6470..2fd36cee8 100644 --- a/modules/ridership/RidershipDetails.tsx +++ b/modules/ridership/RidershipDetails.tsx @@ -5,6 +5,7 @@ import { PageWrapper } from '../../common/layouts/PageWrapper'; import { Layout } from '../../common/layouts/layoutTypes'; import { RIDERSHIP_KEYS } from '../../common/types/lines'; import { ChartPlaceHolder } from '../../common/components/graphics/ChartPlaceHolder'; +import { ChartPageDiv } from '../../common/components/charts/ChartPageDiv'; import { WidgetDiv } from '../../common/components/widgets/WidgetDiv'; import { SPEED_RANGE_PARAM_MAP } from '../speed/constants/speeds'; import { WidgetTitle } from '../dashboard/WidgetTitle'; @@ -32,24 +33,26 @@ export function RidershipDetails() { return ( - - + + + - {ridership.data && ridershipDataReady ? ( - - ) : ( -
- -
- )} -
+ {ridership.data && ridershipDataReady ? ( + + ) : ( +
+ +
+ )} +
+
); } diff --git a/modules/service/ServiceDetails.tsx b/modules/service/ServiceDetails.tsx index 8c1988116..9456774aa 100644 --- a/modules/service/ServiceDetails.tsx +++ b/modules/service/ServiceDetails.tsx @@ -9,6 +9,7 @@ import { Layout } from '../../common/layouts/layoutTypes'; import { PageWrapper } from '../../common/layouts/PageWrapper'; import { getSpeedGraphConfig } from '../speed/constants/speeds'; import { WidgetDiv } from '../../common/components/widgets/WidgetDiv'; +import { ChartPageDiv } from '../../common/components/charts/ChartPageDiv'; import { useDeliveredTripMetrics } from '../../common/api/hooks/tripmetrics'; import { WidgetTitle } from '../dashboard/WidgetTitle'; import { ServiceGraphWrapper } from './ServiceGraphWrapper'; @@ -52,44 +53,42 @@ export function ServiceDetails() { return ( -
-
- - - {serviceDataReady ? ( - - ) : ( -
- -
- )} -
- - - {serviceDataReady ? ( - - ) : ( -
- -
- )} -
-
-
+ + + + {serviceDataReady ? ( + + ) : ( +
+ +
+ )} +
+ + + {serviceDataReady ? ( + + ) : ( +
+ +
+ )} +
+
{' '}
); } diff --git a/modules/slowzones/SlowZonesDetails.tsx b/modules/slowzones/SlowZonesDetails.tsx index f3706e9a3..a03bfadda 100644 --- a/modules/slowzones/SlowZonesDetails.tsx +++ b/modules/slowzones/SlowZonesDetails.tsx @@ -16,6 +16,7 @@ import { WidgetDiv } from '../../common/components/widgets/WidgetDiv'; import type { Direction } from '../../common/types/dataPoints'; import { ButtonGroup } from '../../common/components/general/ButtonGroup'; import { PageWrapper } from '../../common/layouts/PageWrapper'; +import { ChartPageDiv } from '../../common/components/charts/ChartPageDiv'; import { Layout } from '../../common/layouts/layoutTypes'; import { SlowZonesSegmentsWrapper } from './SlowZonesSegmentsWrapper'; import { TotalSlowTimeWrapper } from './TotalSlowTimeWrapper'; @@ -55,7 +56,7 @@ export function SlowZonesDetails() { return ( -
+
@@ -115,7 +116,7 @@ export function SlowZonesDetails() { )}
-
+
); } diff --git a/modules/slowzones/SystemSlowZonesDetails.tsx b/modules/slowzones/SystemSlowZonesDetails.tsx index 197a60b8e..e9c12d00f 100644 --- a/modules/slowzones/SystemSlowZonesDetails.tsx +++ b/modules/slowzones/SystemSlowZonesDetails.tsx @@ -11,6 +11,7 @@ import { Layout } from '../../common/layouts/layoutTypes'; import { filterAllSlow, formatSegments } from '../../common/utils/slowZoneUtils'; import { useBreakpoint } from '../../common/hooks/useBreakpoint'; import { ButtonGroup } from '../../common/components/general/ButtonGroup'; +import { ChartPageDiv } from '../../common/components/charts/ChartPageDiv'; import type { Direction } from '../../common/types/dataPoints'; import { TotalSlowTime } from './charts/TotalSlowTime'; import { LineSegments } from './charts/LineSegments'; @@ -46,7 +47,7 @@ export function SystemSlowZonesDetails({ showTitle = false }: SystemSlowZonesDet return ( -
+
@@ -100,7 +101,7 @@ export function SystemSlowZonesDetails({ showTitle = false }: SystemSlowZonesDet
- + ); } diff --git a/modules/speed/SpeedDetails.tsx b/modules/speed/SpeedDetails.tsx index 60ebb6363..8673c7ca4 100644 --- a/modules/speed/SpeedDetails.tsx +++ b/modules/speed/SpeedDetails.tsx @@ -7,6 +7,7 @@ import { useDelimitatedRoute } from '../../common/utils/router'; import { ChartPlaceHolder } from '../../common/components/graphics/ChartPlaceHolder'; import { Layout } from '../../common/layouts/layoutTypes'; import { PageWrapper } from '../../common/layouts/PageWrapper'; +import { ChartPageDiv } from '../../common/components/charts/ChartPageDiv'; import { useDeliveredTripMetrics } from '../../common/api/hooks/tripmetrics'; import { getSpeedGraphConfig } from './constants/speeds'; import { SpeedDetailsWrapper } from './SpeedDetailsWrapper'; @@ -35,22 +36,20 @@ export function SpeedDetails() { return ( -
-
- {speedReady ? ( - - ) : ( -
- -
- )} -
-
+ + {speedReady ? ( + + ) : ( +
+ +
+ )} +
); } diff --git a/modules/tripexplorer/SubwayTripGraphs.tsx b/modules/tripexplorer/SubwayTripGraphs.tsx index 4b8f34d04..097b5e0fb 100644 --- a/modules/tripexplorer/SubwayTripGraphs.tsx +++ b/modules/tripexplorer/SubwayTripGraphs.tsx @@ -45,7 +45,7 @@ export const SubwayTripGraphs: React.FC = ({ const location = getLocationDetails(fromStation, toStation); return ( -
+ <> {aggregate ? ( <> @@ -166,6 +166,6 @@ export const SubwayTripGraphs: React.FC = ({ )} -
+ ); }; diff --git a/modules/tripexplorer/TripExplorer.tsx b/modules/tripexplorer/TripExplorer.tsx index f5e113ddf..b87ec16c0 100644 --- a/modules/tripexplorer/TripExplorer.tsx +++ b/modules/tripexplorer/TripExplorer.tsx @@ -5,6 +5,7 @@ import { AlertNotice } from '../../common/components/alerts/AlertNotice'; import { SameDayNotice } from '../../common/components/notices/SameDayNotice'; import { TerminusNotice } from '../../common/components/notices/TerminusNotice'; import { PageWrapper } from '../../common/layouts/PageWrapper'; +import { ChartPageDiv } from '../../common/components/charts/ChartPageDiv'; import { Layout } from '../../common/layouts/layoutTypes'; import { useDelimitatedRoute } from '../../common/utils/router'; import { getParentStationForStopId } from '../../common/utils/stations'; @@ -33,12 +34,12 @@ export const TripExplorer = () => { } return ( -
+ {alertsForModal?.length ? : null} -
+
); };