File tree 4 files changed +14
-9
lines changed
4 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ import {
19
19
} from './api'
20
20
import { zoomToStop } from './map'
21
21
22
+ const LIGHT_GRAY = '666666'
23
+
22
24
/**
23
25
* Generic helper for crafting GraphQL queries.
24
26
*/
@@ -436,7 +438,7 @@ const fetchStopInfo = (map, stop) => {
436
438
if ( ! stop ) return findStopError ( )
437
439
438
440
const color =
439
- stop . routes ?. length > 0 && `#${ stop . routes [ 0 ] ?. color || '666666' } `
441
+ stop . routes ?. length > 0 && `#${ stop . routes [ 0 ] ?. color || LIGHT_GRAY } `
440
442
441
443
// Doing some OTP1 compatibility rewriting here
442
444
return {
@@ -586,7 +588,7 @@ export const findRoute = (params) =>
586
588
const patternStops = pattern . stops . map ( ( stop ) => {
587
589
const color =
588
590
stop . routes ?. length > 0 &&
589
- `#${ stop . routes [ 0 ] ?. color || '666666' } `
591
+ `#${ stop . routes [ 0 ] ?. color || LIGHT_GRAY } `
590
592
if ( stop . routes ) delete stop . routes
591
593
return { ...stop , color }
592
594
} )
Original file line number Diff line number Diff line change @@ -102,8 +102,9 @@ export function setViewedRoute(payload) {
102
102
viewedRoute &&
103
103
payload ?. viewedRoute ?. routeId === viewedRoute . routeId &&
104
104
payload ?. viewedRoute ?. patternId === viewedRoute . patternId
105
- )
105
+ ) {
106
106
return
107
+ }
107
108
108
109
dispatch ( viewRoute ( payload ) )
109
110
Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ class PrintLayout extends Component<Props, State> {
67
67
if ( ! itinerary && location && location . search ) {
68
68
parseUrlQueryString ( )
69
69
}
70
+
71
+ // TODO: use currentQuery to pan/zoom to the correct part of the map
70
72
}
71
73
72
74
componentWillUnmount ( ) {
Original file line number Diff line number Diff line change @@ -30,15 +30,15 @@ const borderPixels = (props) => (props?.active ? 3 : 1)
30
30
const caretMarginPixels = ( props ) =>
31
31
( iconPixels - caretPixels - borderPixels ( props ) ) / 2
32
32
33
- const defaultColor = '#a6a6a6'
33
+ const DEFAULT_COLOR = '#a6a6a6'
34
34
35
35
const BaseStopIcon = styled . div `
36
36
background: #fff;
37
37
border-radius: 50%;
38
38
border: ${ borderPixels } px solid
39
- ${ ( props ) => ( props ?. active ? props . mainColor : defaultColor ) } ;
40
- color: ${ ( props ) => ( props ?. active ? props . mainColor : defaultColor ) } ;
41
- fill: ${ ( props ) => ( props ?. active ? props . mainColor : defaultColor ) } ;
39
+ ${ ( props ) => ( props ?. active ? props . mainColor : DEFAULT_COLOR ) } ;
40
+ color: ${ ( props ) => ( props ?. active ? props . mainColor : DEFAULT_COLOR ) } ;
41
+ fill: ${ ( props ) => ( props ?. active ? props . mainColor : DEFAULT_COLOR ) } ;
42
42
font-size: ${ iconPixels } px;
43
43
height: ${ iconPixels } px;
44
44
line-height: 1px;
@@ -56,9 +56,9 @@ const BaseStopIcon = styled.div`
56
56
&::after {
57
57
background: #fff;
58
58
border-bottom: ${ borderPixels } px solid
59
- ${ ( props ) => ( props ?. active ? props . mainColor : defaultColor ) } ;
59
+ ${ ( props ) => ( props ?. active ? props . mainColor : DEFAULT_COLOR ) } ;
60
60
border-right: ${ borderPixels } px solid
61
- ${ ( props ) => ( props ?. active ? props . mainColor : defaultColor ) } ;
61
+ ${ ( props ) => ( props ?. active ? props . mainColor : DEFAULT_COLOR ) } ;
62
62
content: '';
63
63
display: block;
64
64
height: ${ caretPixels } px;
You can’t perform that action at this time.
0 commit comments