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

nearby view new alwaysShowLongName setting #1237

Merged
merged 4 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 4 additions & 1 deletion example-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -668,4 +668,7 @@ itinerary:
### Setting this to true will use the route viewer sort algorithm on routes
# useRouteViewSort: false
### Setting this to false will hide the shadowey dot that appears when dragging the map
# showShadowDotOnMapDrag: false
# showShadowDotOnMapDrag: false
### In routes, this will always show the routeLongName before the headsign
miles-grant-ibigroup marked this conversation as resolved.
Show resolved Hide resolved
### !!! WARNING: in some feeds, this may show the long name twice. In some feeds, this may crash !!!
# alwaysShowLongName: false
1 change: 1 addition & 0 deletions lib/components/viewers/nearby/stop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const Stop = ({
)
return (
<PatternRow
alwaysShowLongName={nearbyViewConfig?.alwaysShowLongName}
homeTimezone={homeTimezone}
key={index}
pattern={st.pattern}
Expand Down
7 changes: 7 additions & 0 deletions lib/components/viewers/pattern-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { NextTripPreview, PatternRowItem } from './styled'
import StopTimeCell from './stop-time-cell'

type Props = {
alwaysShowLongName?: boolean
homeTimezone?: string
pattern: Pattern
roundedTop?: boolean
Expand Down Expand Up @@ -58,6 +59,7 @@ const renderDay = (homeTimezone: string, day: number): JSX.Element => {
* viewer.
*/
const PatternRow = ({
alwaysShowLongName,
homeTimezone,
pattern,
roundedTop = true,
Expand Down Expand Up @@ -101,6 +103,11 @@ const PatternRow = ({
/>
</span>
<span style={{ wordBreak: 'break-word' }} title={pattern.headsign}>
{alwaysShowLongName && (
miles-grant-ibigroup marked this conversation as resolved.
Show resolved Hide resolved
<strong style={{ display: 'block' }}>
{pattern.route.longName}
</strong>
)}
{extractHeadsignFromPattern(pattern) ||
(pattern.route.longName !== routeName && pattern.route.longName)}
</span>
Expand Down
1 change: 1 addition & 0 deletions lib/util/config-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export type BugsnagConfig = ApiKeyConfig
export type MapillaryConfig = ApiKeyConfig

export type NearbyViewConfig = {
alwaysShowLongName?: boolean
hideEmptyStops?: boolean
radius?: number
showShadowDotOnMapDrag?: boolean
Expand Down
Loading