Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the Mattapan trolley #956

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
'7': 5126,
Expand Down
2 changes: 2 additions & 0 deletions common/constants/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const LINE_COLORS: { [key in Line | 'default']: string } = {
'line-blue': COLORS.mbta.blue,
'line-green': COLORS.mbta.green,
'line-bus': COLORS.mbta.bus,
'line-mattapan': COLORS.mbta.red,
'line-commuter-rail': COLORS.mbta.commuterRail,
default: '#303030',
};
Expand All @@ -62,6 +63,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' },
'line-commuter-rail': { 0: '#80276c', 1: '#8f2f7e', 2: '#9e3790', 3: '#ad41a2' },
default: '#303030',
Expand Down
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 @@ -68,7 +68,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 @@ -78,7 +78,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: faCalendarDays,
dateStoreSection: 'multiTrips',
hasStationStore: true,
Expand All @@ -103,7 +103,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
Loading