fix: accessibility issues + tooltip

This commit is contained in:
alexsparkes
2023-09-10 10:02:55 +01:00
parent a4f9d38ea8
commit 5f1e4bd76c
7 changed files with 30 additions and 17 deletions

View File

@@ -76,7 +76,7 @@ class Maximise extends PureComponent {
<Tooltip
title={variables.getMessage('modals.main.settings.sections.background.buttons.view')}
>
<button style={{ fontSize: this.props.fontSize }} onClick={this.maximise}>
<button style={{ fontSize: this.props.fontSize }} onClick={this.maximise} aria-label={variables.getMessage('modals.main.settings.sections.background.buttons.view')}>
<MdCropFree className="topicons" />
</button>
</Tooltip>

View File

@@ -115,7 +115,11 @@ class Navbar extends PureComponent {
title={variables.getMessage('widgets.navbar.tooltips.refresh')}
subtitle={this.state.refreshText}
>
<button onClick={() => this.refresh()} style={{ fontSize: this.state.zoomFontSize }}>
<button
onClick={() => this.refresh()}
style={{ fontSize: this.state.zoomFontSize }}
aria-label={variables.getMessage('widgets.navbar.tooltips.refresh')}
>
<MdRefresh className="refreshicon topicons" />
</button>
</Tooltip>
@@ -130,6 +134,11 @@ class Navbar extends PureComponent {
<button
onClick={() => this.props.openModal('mainModal')}
style={{ fontSize: this.state.zoomFontSize }}
aria-label={variables.getMessage('modals.main.navbar.settings', {
type: variables.getMessage(
'modals.main.navbar.tooltips.refresh_' + this.refreshValue,
),
})}
>
<MdSettings className="settings-icon topicons" />
</button>

View File

@@ -97,6 +97,7 @@ class Notes extends PureComponent {
onBlur={() => this.hideNotes()}
ref={this.props.notesRef}
style={{ fontSize: this.state.zoomFontSize }}
aria-label={variables.getMessage('widgets.navbar.notes.title')}
>
<MdAssignment className="topicons" />
</button>

View File

@@ -25,28 +25,28 @@ export default class Quote extends PureComponent {
buttons = {
share: (
<Tooltip title={variables.getMessage('widgets.quote.share')}>
<button onClick={() => this.setState({ shareModal: true })}>
<button onClick={() => this.setState({ shareModal: true })} aria-label={variables.getMessage('widgets.quote.share')}>
<MdIosShare className="copyButton" />
</button>
</Tooltip>
),
copy: (
<Tooltip title={variables.getMessage('widgets.quote.copy')}>
<button onClick={() => this.copyQuote()}>
<button onClick={() => this.copyQuote()} aria-label={variables.getMessage('widgets.quote.copy')}>
<MdContentCopy className="copyButton" />
</button>
</Tooltip>
),
unfavourited: (
<Tooltip title={variables.getMessage('widgets.quote.favourite')}>
<button onClick={() => this.favourite()}>
<button onClick={() => this.favourite()} aria-label={variables.getMessage('widgets.quote.favourite')}>
<MdStarBorder className="copyButton" />
</button>
</Tooltip>
),
favourited: (
<Tooltip title={variables.getMessage('widgets.quote.unfavourite')}>
<button onClick={() => this.favourite()}>
<button onClick={() => this.favourite()} aria-label={variables.getMessage('widgets.quote.unfavourite')}>
<MdStar className="copyButton" />
</button>
</Tooltip>
@@ -436,6 +436,7 @@ export default class Quote extends PureComponent {
className="quoteAuthorLink"
target="_blank"
rel="noopener noreferrer"
aria-label="Learn about the author of the quote."
>
{this.state.author}
</a>
@@ -481,6 +482,7 @@ export default class Quote extends PureComponent {
className="quoteAuthorLink"
target="_blank"
rel="noopener noreferrer"
aria-label="Learn about the author of the quote."
>
<MdOpenInNew />
</a>{' '}

View File

@@ -100,7 +100,7 @@ export default class Search extends PureComponent {
if (localStorage.getItem('voiceSearch') === 'true') {
microphone = (
<button onClick={this.startSpeechRecognition} ref={this.micIcon}>
<button onClick={this.startSpeechRecognition} ref={this.micIcon} aria-label="Microphone Search">
<MdMic className="micIcon" />
</button>
);
@@ -211,6 +211,7 @@ export default class Search extends PureComponent {
title={variables.getMessage('modals.main.settings.sections.search.search_engine')}
>
<button
aria-label="Search Engine"
onClick={() => this.setState({ searchDropdown: !this.state.searchDropdown })}
>
{this.getSearchDropdownicon(this.state.currentSearch)}
@@ -228,7 +229,7 @@ export default class Search extends PureComponent {
<form onSubmit={this.searchButton} className="searchBar">
<div className={this.state.classList}>
<Tooltip title={variables.getMessage('widgets.search')}>
<button onClick={this.searchButton}>
<button onClick={this.searchButton} aria-label="Search">
<MdSearch />
</button>
</Tooltip>