Skip to content
Snippets Groups Projects
Commit b9d2ffe1 authored by esikkala's avatar esikkala
Browse files

Accessibility improvements

parent d8dc7bb4
No related branches found
No related tags found
No related merge requests found
...@@ -257,8 +257,8 @@ class FacetBar extends React.Component { ...@@ -257,8 +257,8 @@ class FacetBar extends React.Component {
}} }}
expandIcon={<ExpandMoreIcon />} expandIcon={<ExpandMoreIcon />}
IconButtonProps={{ onClick: this.handleExpandButtonOnClick(facetID) }} IconButtonProps={{ onClick: this.handleExpandButtonOnClick(facetID) }}
aria-controls='panel1a-content' aria-controls={`${facetID}-content`}
id='panel1a-header' id={`${facetID}-header`}
> >
<FacetHeader <FacetHeader
facetID={facetID} facetID={facetID}
......
...@@ -374,7 +374,7 @@ class FacetHeader extends React.Component { ...@@ -374,7 +374,7 @@ class FacetHeader extends React.Component {
title={facetDescription} title={facetDescription}
enterDelay={300} enterDelay={300}
> >
<IconButton> <IconButton aria-label='description'>
<InfoIcon /> <InfoIcon />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
......
...@@ -22,6 +22,11 @@ const styles = theme => ({ ...@@ -22,6 +22,11 @@ const styles = theme => ({
}, },
button: { button: {
margin: theme.spacing(1) margin: theme.spacing(1)
},
infoText: {
[theme.breakpoints.down('xl')]: {
fontWeight: 'bold'
}
} }
}) })
...@@ -53,7 +58,7 @@ class FacetInfo extends React.Component { ...@@ -53,7 +58,7 @@ class FacetInfo extends React.Component {
const { screenSize } = this.props const { screenSize } = this.props
let variant = 'h6' let variant = 'h6'
if (screenSize === 'xs' || screenSize === 'sm' || screenSize === 'md' || screenSize === 'lg') { if (screenSize === 'xs' || screenSize === 'sm' || screenSize === 'md' || screenSize === 'lg') {
variant = 'subtitle2' variant = 'body1'
} }
return variant return variant
} }
...@@ -99,7 +104,7 @@ class FacetInfo extends React.Component { ...@@ -99,7 +104,7 @@ class FacetInfo extends React.Component {
<div className={classes.root}> <div className={classes.root}>
{this.props.fetchingResultCount {this.props.fetchingResultCount
? <CircularProgress style={{ color: purple[500] }} thickness={5} size={26} /> ? <CircularProgress style={{ color: purple[500] }} thickness={5} size={26} />
: <Typography variant={this.getTypographyVariant()}>{intl.get('facetBar.results')}: {resultCount} {intl.get(`perspectives.${resultClass}.facetResultsType`)}</Typography>} : <Typography className={classes.infoText} variant={this.getTypographyVariant()}>{intl.get('facetBar.results')}: {resultCount} {intl.get(`perspectives.${resultClass}.facetResultsType`)}</Typography>}
{!mobileMode && <Divider className={classes.facetInfoDivider} />} {!mobileMode && <Divider className={classes.facetInfoDivider} />}
{(activeUriFilters || {(activeUriFilters ||
activeSpatialFilters || activeSpatialFilters ||
...@@ -137,7 +142,7 @@ class FacetInfo extends React.Component { ...@@ -137,7 +142,7 @@ class FacetInfo extends React.Component {
</div> </div>
<Divider className={classes.facetInfoDivider} /> <Divider className={classes.facetInfoDivider} />
</>} </>}
{!mobileMode && <Typography variant={this.getTypographyVariant()}>{intl.get('facetBar.narrowDownBy')}:</Typography>} {!mobileMode && <Typography className={classes.infoText} variant={this.getTypographyVariant()}>{intl.get('facetBar.narrowDownBy')}:</Typography>}
</div> </div>
) )
} }
......
...@@ -274,7 +274,7 @@ class LeafletMap extends React.Component { ...@@ -274,7 +274,7 @@ class LeafletMap extends React.Component {
initMap = () => { initMap = () => {
// Base layer(s) // Base layer(s)
const mapboxBaseLayer = L.tileLayer(`https://api.mapbox.com/styles/v1/mapbox/${this.props.mapBoxStyle}/tiles/{z}/{x}/{y}?access_token=${this.props.mapBoxAccessToken}`, { const mapboxBaseLayer = L.tileLayer(`https://api.mapbox.com/styles/v1/mapbox/${this.props.mapBoxStyle}/tiles/{z}/{x}/{y}?access_token=${this.props.mapBoxAccessToken}`, {
attribution: '&copy; <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> &copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors', attribution: '&copy; <a href="https://www.mapbox.com/map-feedback/" target="_blank" rel="noopener">Mapbox</a> &copy; <a href="http://osm.org/copyright" target="_blank" rel="noopener">OpenStreetMap</a> contributors',
tileSize: 512, tileSize: 512,
zoomOffset: -1 zoomOffset: -1
}) })
......
...@@ -117,8 +117,8 @@ const InfoHeader = props => { ...@@ -117,8 +117,8 @@ const InfoHeader = props => {
content: classes.summaryContent content: classes.summaryContent
}} }}
expandIcon={<ExpandMoreIcon />} expandIcon={<ExpandMoreIcon />}
aria-controls='panel1a-content' aria-controls='infoheader-content'
id='panel1a-header' id='infoheader-header'
IconButtonProps={{ onClick: handleExpandButtonOnClick }} IconButtonProps={{ onClick: handleExpandButtonOnClick }}
> >
<div className={classes.headingContainer}> <div className={classes.headingContainer}>
...@@ -126,7 +126,7 @@ const InfoHeader = props => { ...@@ -126,7 +126,7 @@ const InfoHeader = props => {
{props.pageType === 'facetResults' && intl.get(`perspectives.${props.resultClass}.label`)} {props.pageType === 'facetResults' && intl.get(`perspectives.${props.resultClass}.label`)}
{props.pageType === 'instancePage' && intl.get(`perspectives.${props.resultClass}.instancePage.label`)} {props.pageType === 'instancePage' && intl.get(`perspectives.${props.resultClass}.instancePage.label`)}
</Typography> </Typography>
<IconButton className={classes.infoIconButton} onClick={handleExpandButtonOnClick}> <IconButton aria-label='open instructions' className={classes.infoIconButton} onClick={handleExpandButtonOnClick}>
<InfoIcon className={classes.infoIcon} /> <InfoIcon className={classes.infoIcon} />
</IconButton> </IconButton>
</div> </div>
......
...@@ -74,7 +74,8 @@ class PerspectiveTabs extends React.Component { ...@@ -74,7 +74,8 @@ class PerspectiveTabs extends React.Component {
<Tab <Tab
classes={{ classes={{
root: classes.tabRoot, root: classes.tabRoot,
labelIcon: classes.tabLabelIcon labelIcon: classes.tabLabelIcon,
wrapper: classes.tabWrapper
}} }}
key={tab.id} key={tab.id}
icon={tab.icon} icon={tab.icon}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment