Skip to content

Commit

Permalink
chore: clean up irrelevant props crom container
Browse files Browse the repository at this point in the history
Also, treat long shortName truncation as a prop from parent
  • Loading branch information
vesameskanen committed Dec 23, 2024
1 parent 7b841c3 commit a01a4c9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
1 change: 0 additions & 1 deletion app/component/RouteNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,5 +282,4 @@ RouteNumber.contextTypes = {
config: configShape.isRequired,
};

RouteNumber.displayName = 'RouteNumber';
export default RouteNumber;
29 changes: 1 addition & 28 deletions app/component/RouteNumberContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,31 @@ import { getRouteText } from '../util/legUtils';
import RouteNumber from './RouteNumber';

const RouteNumberContainer = (
{
alertSeverityLevel,
interliningWithRoute,
className,
route,
isCallAgency,
occupancyStatus,
mode,
...props
},
{ interliningWithRoute, route, mode, ...props },
{ config },
) =>
route && (
<RouteNumber
alertSeverityLevel={alertSeverityLevel}
className={className}
isCallAgency={isCallAgency}
color={route.color ? `#${route.color}` : null}
mode={mode !== undefined ? mode : route.mode}
text={getRouteText(route, config, interliningWithRoute)}
shortenLongText
occupancyStatus={occupancyStatus}
{...props}
/>
);

RouteNumberContainer.propTypes = {
alertSeverityLevel: PropTypes.string,
route: routeShape.isRequired,
interliningWithRoute: PropTypes.string,
isCallAgency: PropTypes.bool,
vertical: PropTypes.bool,
className: PropTypes.string,
fadeLong: PropTypes.bool,
occupancyStatus: PropTypes.string,
mode: PropTypes.string,
};

RouteNumberContainer.defaultProps = {
interliningWithRoute: undefined,
alertSeverityLevel: undefined,
isCallAgency: false,
vertical: false,
fadeLong: false,
className: '',
occupancyStatus: undefined,
mode: undefined,
};

RouteNumberContainer.contextTypes = {
config: configShape.isRequired,
};

RouteNumberContainer.displayName = 'RouteNumberContainer';
export default RouteNumberContainer;

0 comments on commit a01a4c9

Please sign in to comment.