Skip to content

Commit

Permalink
Added paging indicators.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaddox5 committed Nov 5, 2024
1 parent 2cb6c73 commit 9fad0bc
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
12 changes: 12 additions & 0 deletions assets/css/v2/elevator/elevator_closures.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@
}
}

.paging-info-container {
display: flex;
justify-content: space-between;

.paging-indicators {
display: flex;
align-items: center;
gap: 27px;
margin-right: 66px;
}
}

.paging-info-container,
.alert-row__elevator-name {
font-weight: 400;
Expand Down
14 changes: 12 additions & 2 deletions assets/src/components/v2/elevator/elevator_closures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import React, {
} from "react";
import NormalService from "Images/svgr_bundled/normal-service.svg";
import AccessibilityAlert from "Images/svgr_bundled/accessibility-alert.svg";
import PagingDotUnselected from "Images/svgr_bundled/paging_dot_unselected.svg";
import PagingDotSelected from "Images/svgr_bundled/paging_dot_selected.svg";
import makePersistent, { WrappedComponentProps } from "../persistent_wrapper";
import RoutePill, { routePillKey, type Pill } from "../departures/route_pill";

Expand Down Expand Up @@ -143,7 +145,6 @@ const OutsideAlertList = ({
}, [visibleAlerts]);

const alertsToRender = doneGettingPages ? pages[pageIndex] : visibleAlerts;

return (
<div className="outside-alert-list">
<div className="header">
Expand All @@ -164,7 +165,16 @@ const OutsideAlertList = ({
</div>
{pages.length && (
<div className="paging-info-container">
+{alerts.length - pages[pageIndex].length} more elevators
<div>+{alerts.length - pages[pageIndex].length} more elevators</div>
<div className="paging-indicators">
{[...Array(pages.length)].map((_, i) => {
return pageIndex === i ? (
<PagingDotSelected key={i} />
) : (
<PagingDotUnselected key={i} />
);
})}
</div>
</div>
)}
</div>
Expand Down
3 changes: 3 additions & 0 deletions assets/static/images/svgr_bundled/paging_dot_selected.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/static/images/svgr_bundled/paging_dot_unselected.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9fad0bc

Please sign in to comment.