Skip to content

Commit d2288fa

Browse files
refactor: address pr feedback
1 parent d8adbd7 commit d2288fa

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

Diff for: lib/components/app/locale-selector.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ const LocaleSelector = (props: LocaleSelectorProps): JSX.Element | null => {
2121
getLanguageOptions(configLanguages)
2222
const intl = useIntl()
2323

24+
const onEnterOrSpace = (e: KeyboardEvent, action: () => void): void => {
25+
if (e.key === 'Space' || e.key === 'Enter') {
26+
action()
27+
}
28+
}
29+
2430
// Only render if two or more languages are configured.
2531
return languageOptions ? (
2632
<Dropdown
@@ -45,7 +51,8 @@ const LocaleSelector = (props: LocaleSelectorProps): JSX.Element | null => {
4551
key={locale}
4652
lang={locale}
4753
onClick={() => setLocale(locale)}
48-
onKeyPress={() => setLocale(locale)}
54+
// @ts-expect-error TODO: repair this type. Handler is not guaranteed to have 'key'
55+
onKeyPress={(e) => onEnterOrSpace(e, () => setLocale(locale))}
4956
// We are correct, not eslint: https://w3c.github.io/aria-practices/examples/combobox/combobox-select-only.html
5057
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
5158
role="option"

Diff for: lib/components/app/view-switcher.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ const ViewSwitcher = ({
6363
<Button
6464
aria-controls="view-switcher"
6565
bsStyle="link"
66-
className={`${tripPlannerActive && 'active'}`}
66+
className={`${tripPlannerActive ? 'active' : ''}`}
6767
onClick={_showTripPlanner}
6868
>
6969
<FormattedMessage id="components.BatchRoutingPanel.shortTitle" />
7070
</Button>
7171
<Button
7272
aria-controls="view-switcher"
7373
bsStyle="link"
74-
className={`${routeViewerActive && 'active'}`}
74+
className={`${routeViewerActive ? 'active' : ''}`}
7575
onClick={_showRouteViewer}
7676
>
7777
<FormattedMessage id="components.RouteViewer.shortTitle" />

Diff for: lib/components/mobile/mobile.css

+3-4
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,20 @@
2020
.otp .navbar .mobile-header {
2121
align-items: center;
2222
display: flex;
23-
height: 60px;
23+
height: 50px;
2424
justify-content: center;
2525
left: 50px;
26-
max-width: 70%;
26+
max-width: 90%;
2727
position: fixed;
2828
right: 50px;
2929
text-align: center;
30-
top: -11px;
3130
}
3231

3332
.otp .navbar .mobile-header-text {
3433
color: white;
3534
display: inline-block;
3635
font-size: 18px;
37-
padding-top: 9px;
36+
margin: 0;
3837
}
3938

4039
@media (max-width: 768px) {

Diff for: lib/components/narrative/default/itinerary-summary.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const Block = connect(mapStateToProps)(styled.div`
4747
4848
span {
4949
display: ${(props) => (props.renderRouteNamesAndColors ? 'block' : 'none')};
50-
margin-top: -3px;
50+
align-self: center;
5151
}
5252
5353
svg {

0 commit comments

Comments
 (0)