Skip to content

Commit

Permalink
fix: make green line slow zones page unselectable (#922)
Browse files Browse the repository at this point in the history
  • Loading branch information
rudiejd authored Jan 6, 2024
1 parent c4f39cf commit d8a32c6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions common/components/nav/SubwayDropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import classNames from 'classnames';
import React from 'react';
import { SidebarTabs } from '../../../modules/navigation/SidebarTabs';
import { OVERVIEW_PAGE, LINE_PAGES, TRIP_PAGES } from '../../constants/pages';
import { OVERVIEW_PAGE, LINE_PAGES, TRIP_PAGES, ALL_PAGES } from '../../constants/pages';
import { lineColorBorder } from '../../styles/general';
import type { Line } from '../../types/lines';

Expand All @@ -21,7 +21,14 @@ export const SubwayDropdown: React.FC<SubwayDropdownProps> = ({ line, close }) =
>
<SidebarTabs tabs={OVERVIEW_PAGE} close={close} />
<hr className="h-[1px] w-3/4 self-center border-neutral-500" />
<SidebarTabs tabs={LINE_PAGES} close={close} />
<SidebarTabs
tabs={
line === 'line-green'
? LINE_PAGES.filter((cur) => cur !== ALL_PAGES.slowzones)
: LINE_PAGES
}
close={close}
/>
<hr className="h-[1px] w-3/4 self-center border-neutral-500" />
<SidebarTabs tabs={TRIP_PAGES} close={close} />
</div>
Expand Down
1 change: 1 addition & 0 deletions common/types/lines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const BUS_ROUTES: BusRoute[] = [
'220/221/222',
];

// potential TODO: make this a type or make the line names for routing constants
export const ALL_LINE_PATHS = RAIL_LINES.map((line) => {
return {
params: {
Expand Down
2 changes: 1 addition & 1 deletion pages/[line]/slowzones.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function getStaticProps() {

export async function getStaticPaths() {
return {
paths: ALL_LINE_PATHS,
paths: ALL_LINE_PATHS.filter((p) => p.params.line !== 'green'),
fallback: false,
};
}
Expand Down

0 comments on commit d8a32c6

Please sign in to comment.