From: Mitch Lillie Date: Sat, 6 Feb 2021 20:20:41 +0000 (-0800) Subject: Add aria attributes where possible (#156) X-Git-Url: http://these/git/ui/assets/static/%7BpictrsAvatarThumbnail%28user.avatar%29%7D?a=commitdiff_plain;h=04955cc45ecfab8b9da5f17521acadc382a76c0e;p=lemmy-ui.git Add aria attributes where possible (#156) * Add aria attributes where possible * Bump submodule to get aria translations --- diff --git a/lemmy-translations b/lemmy-translations index a47ae3f..084ce53 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit a47ae3f825f74ad7a6106b92e21d3c66b10d3fe8 +Subproject commit 084ce539fff5253317d6460598b10a6867999c20 diff --git a/src/shared/components/banner-icon-header.tsx b/src/shared/components/banner-icon-header.tsx index cb84eb2..050ace1 100644 --- a/src/shared/components/banner-icon-header.tsx +++ b/src/shared/components/banner-icon-header.tsx @@ -14,12 +14,13 @@ export class BannerIconHeader extends Component { render() { return (
- {this.props.banner && } + {this.props.banner && } {this.props.icon && ( )}
diff --git a/src/shared/components/comment-node.tsx b/src/shared/components/comment-node.tsx index 071c238..26eeaf0 100644 --- a/src/shared/components/comment-node.tsx +++ b/src/shared/components/comment-node.tsx @@ -198,6 +198,9 @@ export class CommentNode extends Component { @@ -248,6 +251,11 @@ export class CommentNode extends Component { ? i18n.t('mark_as_unread') : i18n.t('mark_as_read') } + aria-label={ + this.commentOrMentionRead + ? i18n.t('mark_as_unread') + : i18n.t('mark_as_read') + } > {this.state.readLoading ? ( this.loadingIcon @@ -270,6 +278,7 @@ export class CommentNode extends Component { }`} onClick={linkEvent(node, this.handleCommentUpvote)} data-tippy-content={i18n.t('upvote')} + aria-label={i18n.t('upvote')} > @@ -287,6 +296,7 @@ export class CommentNode extends Component { }`} onClick={linkEvent(node, this.handleCommentDownvote)} data-tippy-content={i18n.t('downvote')} + aria-label={i18n.t('downvote')} > @@ -300,6 +310,7 @@ export class CommentNode extends Component { class="btn btn-link btn-animate text-muted" onClick={linkEvent(this, this.handleReplyClick)} data-tippy-content={i18n.t('reply')} + aria-label={i18n.t('reply')} > @@ -310,6 +321,7 @@ export class CommentNode extends Component { className="btn btn-link btn-animate text-muted" onClick={linkEvent(this, this.handleShowAdvanced)} data-tippy-content={i18n.t('more')} + aria-label={i18n.t('more')} > @@ -340,6 +352,9 @@ export class CommentNode extends Component { data-tippy-content={ cv.saved ? i18n.t('unsave') : i18n.t('save') } + aria-label={ + cv.saved ? i18n.t('unsave') : i18n.t('save') + } > {this.state.saveLoading ? ( this.loadingIcon @@ -357,6 +372,7 @@ export class CommentNode extends Component { className="btn btn-link btn-animate text-muted" onClick={linkEvent(this, this.handleViewSource)} data-tippy-content={i18n.t('view_source')} + aria-label={i18n.t('view_source')} > { class="btn btn-link btn-animate text-muted" onClick={linkEvent(this, this.handleEditClick)} data-tippy-content={i18n.t('edit')} + aria-label={i18n.t('edit')} > @@ -388,6 +405,11 @@ export class CommentNode extends Component { ? i18n.t('delete') : i18n.t('restore') } + aria-label={ + !cv.comment.deleted + ? i18n.t('delete') + : i18n.t('restore') + } > { {this.state.showBanDialog && (
- + { {cv.subscribed ? ( { ) : ( - + diff --git a/src/shared/components/inbox.tsx b/src/shared/components/inbox.tsx index 4390b8e..ab0c312 100644 --- a/src/shared/components/inbox.tsx +++ b/src/shared/components/inbox.tsx @@ -172,6 +172,7 @@ export class Inbox extends Component {
  • {i18n.t('mark_all_as_read')} diff --git a/src/shared/components/login.tsx b/src/shared/components/login.tsx index acd05a3..7006ae7 100644 --- a/src/shared/components/login.tsx +++ b/src/shared/components/login.tsx @@ -326,6 +326,7 @@ export class Login extends Component { class="rounded-top img-fluid" src={this.captchaPngSrc()} style="border-bottom-right-radius: 0; border-bottom-left-radius: 0;" + alt={i18n.t('captcha')} /> {this.state.captcha.ok.wav && (
  • - +
    - + {