@@ -20,28 +20,23 @@ import { getModeFromStop, getStopName } from '../../util/viewer'
20
20
21
21
const { ViewStopButton } = StopsOverlayStyled
22
22
23
- const getComplementaryColor = ( color ) =>
24
- color . isLight ( ) ? color . darken ( 30 ) : color . lighten ( 40 )
25
-
26
- const caretPixels = 18
27
23
const iconPixels = 32
28
24
const iconPadding = 5
25
+ const caretPixels = iconPixels / 2 + iconPadding
29
26
const borderPixels = ( props ) => ( props ?. active ? 3 : 1 )
30
- const caretMarginPixels = ( props ) =>
31
- ( iconPixels - caretPixels - borderPixels ( props ) ) / 2
27
+ const leftPixels = ( props ) => caretPixels / 2 - borderPixels ( props ) / 2
28
+ const bottomPixels = ( props ) =>
29
+ - ( ( caretPixels * 1.4142 ) / 4 ) - borderPixels ( props ) + iconPadding / 2
32
30
33
31
const DEFAULT_COLOR = '#a6a6a6'
32
+ const strokeColor = ( props ) => ( props ?. active ? props . mainColor : DEFAULT_COLOR )
34
33
35
34
const BaseStopIcon = styled . div `
36
35
background: #fff;
36
+ border: ${ borderPixels } px solid ${ strokeColor } ;
37
37
border-radius: 50%;
38
- border: ${ borderPixels } px solid
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
- font-size: ${ iconPixels } px;
38
+ fill: ${ strokeColor } ;
43
39
height: ${ iconPixels } px;
44
- line-height: 1px;
45
40
padding: ${ iconPadding } px;
46
41
position: relative;
47
42
width: ${ iconPixels } px;
@@ -55,19 +50,17 @@ const BaseStopIcon = styled.div`
55
50
56
51
&::after {
57
52
background: #fff;
58
- border-bottom: ${ borderPixels } px solid
59
- ${ ( props ) => ( props ?. active ? props . mainColor : DEFAULT_COLOR ) } ;
60
- border-right : ${ borderPixels } px solid
61
- ${ ( props ) => ( props ?. active ? props . mainColor : DEFAULT_COLOR ) } ;
53
+ border-bottom: ${ borderPixels } px solid ${ strokeColor } ;
54
+ border-right: ${ borderPixels } px solid ${ strokeColor } ;
55
+ bottom : ${ bottomPixels } px;
56
+ box-sizing: content-box ;
62
57
content: '';
63
58
display: block;
64
59
height: ${ caretPixels } px;
60
+ left: ${ leftPixels } px;
61
+ position: absolute;
65
62
transform: rotate(45deg);
66
63
width: ${ caretPixels } px;
67
-
68
- /* FIXME: figure out how these numbers can be calculated */
69
- margin-left: ${ caretMarginPixels } px;
70
- margin-top: -${ caretMarginPixels } px;
71
64
}
72
65
`
73
66
@@ -128,7 +121,6 @@ class EnhancedStopMarker extends Component {
128
121
129
122
return (
130
123
< MarkerWithPopup
131
- markerProps = { { anchor : 'top' , offset : [ 1 , - 12 ] } }
132
124
popupContents = {
133
125
activeStopId !== stop . id && (
134
126
< BaseMapStyled . MapOverlayPopup >
@@ -179,8 +171,7 @@ const mapStateToProps = (state, ownProps) => {
179
171
activeStopId : state . otp . ui . viewedStop ?. stopId ,
180
172
highlight : highlightedStop === ownProps . stop . id ,
181
173
languageConfig : state . otp . config . language ,
182
- modeColors,
183
- stop : ownProps . stop
174
+ modeColors
184
175
}
185
176
}
186
177
0 commit comments