Skip to content
Merged
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
23 changes: 13 additions & 10 deletions app/component/DepartureRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export default function DepartureRow(
);
let icon;
let iconColor;
let backgroundShape;
let background;
let backgroundClass;
let sr;
if (
route?.alerts?.filter(alert => isAlertValid(alert, props.currentTime))
Expand All @@ -61,13 +62,15 @@ export default function DepartureRow(
})}
</span>
);
icon =
alert.alertSeverityLevel !== 'INFO'
? 'icon_caution-white-excl-stroke'
: 'icon_info';
iconColor = alert.alertSeverityLevel !== 'INFO' ? '#DC0451' : '#888';
backgroundShape =
alert.alertSeverityLevel !== 'INFO' ? undefined : 'circle';
if (alert.alertSeverityLevel === 'INFO') {
icon = 'icon_info';
iconColor = '#888';
background = <IconBackground backgroundShape="circle" />;
backgroundClass = 'circle';
} else {
icon = 'icon_caution-white-excl-stroke';
iconColor = '#DC0451';
}
}
const headsign =
departure.headsign ||
Expand Down Expand Up @@ -174,10 +177,10 @@ export default function DepartureRow(
{icon && (
<>
<Icon
className={backgroundShape}
className={backgroundClass}
img={icon}
color={iconColor}
background={<IconBackground backgroundShape={backgroundShape} />}
background={background}
/>
{sr}
</>
Expand Down
2 changes: 1 addition & 1 deletion app/component/routepage/RouteControlPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ class RouteControlPanel extends React.Component {
let disruptionIcon;
if (disruptionClassName === 'active-disruption-alert') {
disruptionIcon = (
<Icon className="disrution-icon" img="icon_caution-no-excl-no-stroke" />
<Icon img="icon_caution-no-excl-no-stroke" color="#DC0451" />
);
} else if (disruptionClassName === 'active-service-alert') {
disruptionIcon = <Icon className="service-alert-icon" img="icon_info" />;
Expand Down
10 changes: 9 additions & 1 deletion app/component/routepage/RoutePatternSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ export default function RoutePatternSelect(
{ currentPattern, optionArray, onSelectChange, className },
{ config, router },
) {
if (!currentPattern) {
return null;
}

// flatten optionArray to an ungrouped 1-D array
const flattenedOptions = optionArray.reduce(
(options, group) => options.concat(group.options),
Expand Down Expand Up @@ -256,7 +260,7 @@ export default function RoutePatternSelect(
}

RoutePatternSelect.propTypes = {
currentPattern: patternShape.isRequired,
currentPattern: patternShape,
optionArray: PropTypes.arrayOf(
PropTypes.shape({
name: PropTypes.string,
Expand All @@ -267,6 +271,10 @@ RoutePatternSelect.propTypes = {
className: PropTypes.string.isRequired,
};

RoutePatternSelect.defaultProps = {
currentPattern: undefined,
};

RoutePatternSelect.contextTypes = {
config: configShape.isRequired,
router: routerShape.isRequired,
Expand Down
2 changes: 1 addition & 1 deletion app/component/stop/StopPageTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function StopPageTabs({ stop }, { match }) {
) {
disruptionClassName = 'active-disruption-alert';
disruptionIcon = (
<Icon className="disrution-icon" img="icon_caution-no-excl-no-stroke" />
<Icon img="icon_caution-no-excl-no-stroke" color="#DC0451" />
);
} else if (maxAlertSeverity === AlertSeverityLevelType.Info) {
disruptionClassName = 'active-service-alert';
Expand Down
31 changes: 18 additions & 13 deletions static/assets/svg-sprite.default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading