Skip to content

Commit

Permalink
Merge pull request #1752 from HSLdevcom/DT-2086
Browse files Browse the repository at this point in the history
DT-2086 Add aria label to itinerary alternatives
  • Loading branch information
rrudd authored Aug 7, 2017
2 parents 74bb585 + c8fe4e8 commit 3071f86
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions app/component/MobileItineraryWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import Tabs from 'material-ui/Tabs/Tabs';
import Tab from 'material-ui/Tabs/Tab';
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
import { FormattedMessage } from 'react-intl';
import { FormattedMessage, intlShape } from 'react-intl';
import SwipeableViews from 'react-swipeable-views';

import { getRoutePath } from '../util/path';
Expand All @@ -23,9 +23,15 @@ export default class MobileItineraryWrapper extends React.Component {
static contextTypes = {
router: PropTypes.object.isRequired,
location: PropTypes.object.isRequired,
intl: intlShape.isRequired,
};

static getTabs(itineraries, selectedIndex) {
state = {
lat: undefined,
lon: undefined,
};

getTabs(itineraries, selectedIndex) {
return itineraries.map((itinerary, i) =>
<Tab
selected={i === selectedIndex}
Expand All @@ -43,15 +49,14 @@ export default class MobileItineraryWrapper extends React.Component {
fontSize: '34px',
padding: '0px',
}}
aria-label={`${this.context.intl.formatMessage({
id: 'itinerary-page.title',
defaultMessage: 'Itinerary',
})} ${i + 1}`}
/>,
);
}

state = {
lat: undefined,
lon: undefined,
};

itineraryTabs = [];

toggleFullscreenMap = () => {
Expand Down Expand Up @@ -134,7 +139,7 @@ export default class MobileItineraryWrapper extends React.Component {
}}
inkBarStyle={{ display: 'none' }}
>
{MobileItineraryWrapper.getTabs(this.props.children, index)}
{this.getTabs(this.props.children, index)}
</Tabs>
</div>;

Expand Down

0 comments on commit 3071f86

Please sign in to comment.