Skip to content

Commit

Permalink
Adding the Mattapan trolley
Browse files Browse the repository at this point in the history
  • Loading branch information
devinmatte committed Mar 10, 2024
1 parent 62dfc19 commit 1404f42
Show file tree
Hide file tree
Showing 14 changed files with 489 additions and 1,088 deletions.
2 changes: 1 addition & 1 deletion common/api/alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const fetchAlerts = async (

const fetchAlertsForLine = async (line: LineShort): Promise<AlertsResponse[]> => {
const options = { ...alertsAPIConfig };
if (line === 'Green') {
if (line === 'Green' || line === 'Mattapan') {
// route_type 0 is light rail (green line & Mattapan)
options['route_type'] = '0';
} else {
Expand Down
1 change: 1 addition & 0 deletions common/components/graphics/styles/spinnerFillColor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const spinnerFillColor: StyleMap = {
'line-orange': 'fill-mbta-orange',
'line-green': 'fill-mbta-green',
'line-blue': 'fill-mbta-blue',
'line-mattapan': 'fill-mbta-red',
'line-bus': 'fill-mbta-bus',
'line-commuter-rail': 'fill-mbta-commuterRail',
};
1 change: 1 addition & 0 deletions common/components/nav/MenuDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const MenuDropdown: React.FC<MenuDropdownProps> = ({ line, route, childre
case 'line-bus':
return faBus;
case 'line-green':
case 'line-mattapan':
return faTrainTram;
case 'line-commuter-rail':
return faTrain;
Expand Down
2 changes: 1 addition & 1 deletion common/components/nav/SubwayDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const SubwayDropdown: React.FC<SubwayDropdownProps> = ({ line, close }) =
<hr className="h-[1px] w-3/4 self-center border-neutral-500" />
<SidebarTabs
tabs={
line === 'line-green'
line === 'line-green' || line === 'line-mattapan'
? LINE_PAGES.filter((cur) => cur !== ALL_PAGES.slowzones)
: LINE_PAGES
}
Expand Down
3 changes: 3 additions & 0 deletions common/components/nav/SubwaySection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export const SubwaySection: React.FC<SubwaySectionProps> = ({ close }) => {
<MenuDropdown line="line-green" route={route}>
<SubwayDropdown line="line-green" close={close} />
</MenuDropdown>
<MenuDropdown line="line-mattapan" route={route}>
<SubwayDropdown line="line-mattapan" close={close} />
</MenuDropdown>
</div>
);
};
1 change: 1 addition & 0 deletions common/constants/baselines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const PEAK_RIDERSHIP: {
'line-orange': 169578,
'line-blue': 60129,
'line-green': 87148,
'line-mattapan': 0,
'1': 15272,
'4': 850,
'9': 7116,
Expand Down
2 changes: 2 additions & 0 deletions common/constants/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const LINE_COLORS = {
'line-orange': '#ed8b00',
'line-blue': '#003da5',
'line-green': '#00834d',
'line-mattapan': '#D13434',
'line-bus': '#ffc72c',
default: '#303030',
};
Expand All @@ -57,6 +58,7 @@ export const LINE_COLORS_LEVELS = {
'line-orange': { 0: '#ed8b00', 1: '#ff9907', 2: '#ffa321', 3: '#ffae3b' },
'line-blue': { 0: '#003da5', 1: '#0046bf', 2: '#0050d8', 3: '#0059f2' },
'line-green': { 0: '#00834d', 1: '#009d5c', 2: '#00b66b', 3: '#00d07a' },
'line-mattapan': { 0: '#D13434', 1: '#d64949', 2: '#da5e5e', 3: '#df7272' },
'line-bus': { 0: '#ffc72c', 1: '#ffce46', 2: '#ffd55f', 3: '#ffdb79' },
default: '#303030',
};
7 changes: 7 additions & 0 deletions common/constants/lines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ export const LINE_OBJECTS: LineObject = {
key: 'line-blue',
color: COLORS.mbta.blue,
},
'line-mattapan': {
name: 'Mattapan Trolley',
short: 'Mattapan',
path: 'mattapan',
key: 'line-mattapan',
color: COLORS.mbta.red,
},
'line-bus': {
name: 'Buses',
short: 'Bus',
Expand Down
6 changes: 3 additions & 3 deletions common/constants/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const ALL_PAGES: PageMap = {
path: '/trips/single',
name: 'Trips',
title: 'Trips',
lines: ['line-red', 'line-blue', 'line-green', 'line-orange', 'line-bus'],
lines: ['line-red', 'line-blue', 'line-green', 'line-orange', 'line-mattapan', 'line-bus'],
icon: faMapLocationDot,
hasStationStore: true,
dateStoreSection: 'singleTrips',
Expand All @@ -76,7 +76,7 @@ export const ALL_PAGES: PageMap = {
path: '/trips/multi',
name: 'Multi-day trips',
title: 'Multi-day trips',
lines: ['line-red', 'line-blue', 'line-green', 'line-orange', 'line-bus'],
lines: ['line-red', 'line-blue', 'line-green', 'line-orange', 'line-mattapan', 'line-bus'],
icon: faCalendar,
dateStoreSection: 'multiTrips',
hasStationStore: true,
Expand All @@ -101,7 +101,7 @@ export const ALL_PAGES: PageMap = {
key: 'predictions',
path: '/predictions',
name: 'Predictions',
lines: ['line-red', 'line-orange', 'line-blue', 'line-green'],
lines: ['line-red', 'line-orange', 'line-blue', 'line-green', 'line-mattapan'],
icon: faStopwatch20,
dateStoreSection: 'line',
},
Expand Down
Loading

0 comments on commit 1404f42

Please sign in to comment.