type="button"
class="btn btn-secondary"
onClick={linkEvent(this, this.handleRegenCaptcha)}
+ aria-label={i18n.t('captcha')}
>
- <svg class="icon icon-refresh-cw">
- <use xlinkHref="#icon-refresh-cw"></use>
- </svg>
+ <Icon icon="refresh-cw" classes="icon-refresh-cw" />
</button>
</label>
{this.showCaptcha()}
<button
class="btn btn-sm text-muted"
data-tippy-content={i18n.t('bold')}
+ aria-label={i18n.t('bold')}
onClick={linkEvent(this, this.handleInsertBold)}
>
- <svg class="icon icon-inline">
- <use xlinkHref="#icon-bold"></use>
- </svg>
+ <Icon icon="bold" classes="icon-inline" />
</button>
<button
class="btn btn-sm text-muted"
data-tippy-content={i18n.t('italic')}
+ aria-label={i18n.t('italic')}
onClick={linkEvent(this, this.handleInsertItalic)}
>
- <svg class="icon icon-inline">
- <use xlinkHref="#icon-italic"></use>
- </svg>
+ <Icon icon="italic" classes="icon-inline" />
</button>
<button
class="btn btn-sm text-muted"
data-tippy-content={i18n.t('link')}
+ aria-label={i18n.t('link')}
onClick={linkEvent(this, this.handleInsertLink)}
>
- <svg class="icon icon-inline">
- <use xlinkHref="#icon-link"></use>
- </svg>
+ <Icon icon="link" classes="icon-inline" />
</button>
<form class="btn btn-sm text-muted font-weight-bold">
<label
to="/inbox"
title={i18n.t('inbox')}
>
- <svg class="icon">
- <use xlinkHref="#icon-bell"></use>
- </svg>
+ <Icon icon="bell" />
{this.state.unreadCount > 0 && (
- <span class="mx-1 badge badge-light">
+ <span
+ class="mx-1 badge badge-light"
+ aria-label={`${this.state.unreadCount} ${i18n.t(
+ 'unread_messages'
+ )}`}
+ >
{this.state.unreadCount}
</span>
)}
onClick={linkEvent(this, this.handleSearchBtn)}
class="px-1 btn btn-link"
style="color: var(--gray)"
+ aria-label={i18n.t('search')}
>
- <svg class="icon">
- <use xlinkHref="#icon-search"></use>
- </svg>
+ <Icon icon="search" />
</button>
</form>
)}
to="/inbox"
title={i18n.t('inbox')}
>
- <svg class="icon">
- <use xlinkHref="#icon-bell"></use>
- </svg>
+ <Icon icon="bell" />
{this.state.unreadCount > 0 && (
- <span class="ml-1 badge badge-light">
+ <span
+ class="ml-1 badge badge-light"
+ aria-label={`${this.state.unreadCount} ${i18n.t(
+ 'unread_messages'
+ )}`}
+ >
{this.state.unreadCount}
</span>
)}
class="btn btn-link btn-animate text-muted py-0"
onClick={linkEvent(this, this.handleEditClick)}
data-tippy-content={i18n.t('edit')}
+ aria-label={i18n.t('edit')}
>
- <svg class="icon icon-inline">
- <use xlinkHref="#icon-edit"></use>
- </svg>
+ <Icon icon="edit" classes="icon-inline" />
</button>
<button
class="btn btn-link btn-animate text-muted py-0"
data-tippy-content={
!post_view.post.deleted ? i18n.t('delete') : i18n.t('restore')
}
+ aria-label={
+ !post_view.post.deleted ? i18n.t('delete') : i18n.t('restore')
+ }
>
- <svg
- class={`icon icon-inline ${
+ <Icon
+ icon="trash"
+ classes={`icon-inline ${
post_view.post.deleted && 'text-danger'
}`}
- >
- <use xlinkHref="#icon-trash"></use>
- </svg>
+ />
</button>
</>
)}
class="btn btn-link btn-animate text-muted py-0"
onClick={linkEvent(this, this.handleViewSource)}
data-tippy-content={i18n.t('view_source')}
+ aria-label={i18n.t('view_source')}
>
- <svg
- class={`icon icon-inline ${
+ <Icon
+ icon="file-text"
+ classes={`icon-inline ${
this.state.viewSource && 'text-success'
}`}
- >
- <use xlinkHref="#icon-file-text"></use>
- </svg>
+ />
</button>
)}
{this.canModOnSelf && (
data-tippy-content={
post_view.post.locked ? i18n.t('unlock') : i18n.t('lock')
}
+ aria-label={
+ post_view.post.locked ? i18n.t('unlock') : i18n.t('lock')
+ }
>
- <svg
- class={`icon icon-inline ${
+ <Icon
+ icon="lock"
+ classes={`icon-inline ${
post_view.post.locked && 'text-danger'
}`}
- >
- <use xlinkHref="#icon-lock"></use>
- </svg>
+ />
</button>
<button
class="btn btn-link btn-animate text-muted py-0"
? i18n.t('unsticky')
: i18n.t('sticky')
}
+ aria-label={
+ post_view.post.stickied
+ ? i18n.t('unsticky')
+ : i18n.t('sticky')
+ }
>
- <svg
- class={`icon icon-inline ${
+ <Icon
+ icon="pin"
+ classes={`icon-inline ${
post_view.post.stickied && 'text-success'
}`}
- >
- <use xlinkHref="#icon-pin"></use>
- </svg>
+ />
</button>
</>
)}