File tree 2 files changed +11
-18
lines changed
2 files changed +11
-18
lines changed Original file line number Diff line number Diff line change 126
126
font-size : 14px ;
127
127
line-height : 1.4 ;
128
128
margin-top : -1px ;
129
+ white-space : pre-wrap;
130
+ }
131
+
132
+ .otp .settings-preview .summary .tall {
133
+ line-height : 2.6 ;
129
134
}
130
135
131
136
.otp : not (.mobile ) .settings-preview .summary {
Original file line number Diff line number Diff line change @@ -25,8 +25,7 @@ class SettingsPreview extends Component {
25
25
static defaultProps = {
26
26
editButtonText : < i className = 'fa fa-pencil' /> ,
27
27
messages : {
28
- // Label accepted as two-element array or single (not array) string literal.
29
- label : [ 'Transit Options' , '& Preferences' ]
28
+ label : 'Transit Options\n& Preferences'
30
29
}
31
30
}
32
31
@@ -43,24 +42,13 @@ class SettingsPreview extends Component {
43
42
{ showDot && < div className = 'dot' /> }
44
43
</ div >
45
44
)
46
-
45
+ // Add tall class to account for vertical centering if there is only
46
+ // one line in the label (default is 2).
47
+ const addClass = messages . label . match ( / \n / ) ? '' : ' tall'
47
48
return (
48
49
< div className = 'settings-preview' onClick = { this . props . onClick } >
49
- < div className = 'summary' >
50
- { // If settings preview is multiple lines, split
51
- Array . isArray ( messages . label )
52
- ? < span >
53
- { messages . label [ 0 ] }
54
- < br />
55
- { messages . label [ 1 ] }
56
- </ span >
57
- : < span
58
- // Increase line height if number of lines is 1 for vertical
59
- // centering.
60
- style = { { lineHeight : 2.6 } } >
61
- { messages . label }
62
- </ span >
63
- }
50
+ < div className = { `summary${ addClass } ` } >
51
+ { messages . label }
64
52
</ div >
65
53
{ button }
66
54
< div style = { { clear : 'both' } } />
You can’t perform that action at this time.
0 commit comments