summaryrefslogtreecommitdiffstats
path: root/ui/src/components/sidebar.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-02-02 14:37:19 -0500
committerDessalines <tyhou13@gmx.com>2020-02-02 14:37:19 -0500
commitcaba049da12017f22a8ffa8d6b8e7f0a2cc20e6a (patch)
tree5c53177858098e4d4414896bba53f90f0ceddd78 /ui/src/components/sidebar.tsx
parent96a7e99e57f8c79eead599e6de5d94016f7021e6 (diff)
parent6124133e8517165a97aa87af5485857a000951a2 (diff)
Merge branch 'dev' into websocket_scopes
Diffstat (limited to 'ui/src/components/sidebar.tsx')
-rw-r--r--ui/src/components/sidebar.tsx60
1 files changed, 23 insertions, 37 deletions
diff --git a/ui/src/components/sidebar.tsx b/ui/src/components/sidebar.tsx
index 0e6b68e6..5c8ef1a9 100644
--- a/ui/src/components/sidebar.tsx
+++ b/ui/src/components/sidebar.tsx
@@ -16,7 +16,6 @@ import {
} from '../utils';
import { CommunityForm } from './community-form';
import { i18n } from '../i18next';
-import { T } from 'inferno-i18next';
interface SidebarProps {
community: Community;
@@ -73,12 +72,12 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
<span>{community.title}</span>
{community.removed && (
<small className="ml-2 text-muted font-italic">
- <T i18nKey="removed">#</T>
+ {i18n.t('removed')}
</small>
)}
{community.deleted && (
<small className="ml-2 text-muted font-italic">
- <T i18nKey="deleted">#</T>
+ {i18n.t('deleted')}
</small>
)}
</h5>
@@ -93,7 +92,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
class="pointer"
onClick={linkEvent(this, this.handleEditClick)}
>
- <T i18nKey="edit">#</T>
+ {i18n.t('edit')}
</span>
</li>
{this.amCreator && (
@@ -117,14 +116,14 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
class="pointer"
onClick={linkEvent(this, this.handleModRemoveShow)}
>
- <T i18nKey="remove">#</T>
+ {i18n.t('remove')}
</span>
) : (
<span
class="pointer"
onClick={linkEvent(this, this.handleModRemoveSubmit)}
>
- <T i18nKey="restore">#</T>
+ {i18n.t('restore')}
</span>
)}
</li>
@@ -133,11 +132,12 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
{this.state.showRemoveDialog && (
<form onSubmit={linkEvent(this, this.handleModRemoveSubmit)}>
<div class="form-group row">
- <label class="col-form-label">
- <T i18nKey="reason">#</T>
+ <label class="col-form-label" htmlFor="remove-reason">
+ {i18n.t('reason')}
</label>
<input
type="text"
+ id="remove-reason"
class="form-control mr-2"
placeholder={i18n.t('optional')}
value={this.state.removeReason}
@@ -151,43 +151,29 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
{/* </div> */}
<div class="form-group row">
<button type="submit" class="btn btn-secondary">
- <T i18nKey="remove_community">#</T>
+ {i18n.t('remove_community')}
</button>
</div>
</form>
)}
<ul class="my-1 list-inline">
<li className="list-inline-item badge badge-secondary">
- <T
- i18nKey="number_online"
- interpolation={{ count: this.props.online }}
- >
- #
- </T>
+ {i18n.t('number_online', { count: this.props.online })}
</li>
<li className="list-inline-item badge badge-secondary">
- <T
- i18nKey="number_of_subscribers"
- interpolation={{ count: community.number_of_subscribers }}
- >
- #
- </T>
+ {i18n.t('number_of_subscribers', {
+ count: community.number_of_subscribers,
+ })}
</li>
<li className="list-inline-item badge badge-secondary">
- <T
- i18nKey="number_of_posts"
- interpolation={{ count: community.number_of_posts }}
- >
- #
- </T>
+ {i18n.t('number_of_posts', {
+ count: community.number_of_posts,
+ })}
</li>
<li className="list-inline-item badge badge-secondary">
- <T
- i18nKey="number_of_comments"
- interpolation={{ count: community.number_of_comments }}
- >
- #
- </T>
+ {i18n.t('number_of_comments', {
+ count: community.number_of_comments,
+ })}
</li>
<li className="list-inline-item">
<Link className="badge badge-secondary" to="/communities">
@@ -199,7 +185,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
className="badge badge-secondary"
to={`/modlog/community/${this.props.community.id}`}
>
- <T i18nKey="modlog">#</T>
+ {i18n.t('modlog')}
</Link>
</li>
</ul>
@@ -227,7 +213,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
'no-click'}`}
to={`/create_post?community=${community.name}`}
>
- <T i18nKey="create_a_post">#</T>
+ {i18n.t('create_a_post')}
</Link>
<div>
{community.subscribed ? (
@@ -235,14 +221,14 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
class="btn btn-sm btn-secondary btn-block"
onClick={linkEvent(community.id, this.handleUnsubscribe)}
>
- <T i18nKey="unsubscribe">#</T>
+ {i18n.t('unsubscribe')}
</button>
) : (
<button
class="btn btn-sm btn-secondary btn-block"
onClick={linkEvent(community.id, this.handleSubscribe)}
>
- <T i18nKey="subscribe">#</T>
+ {i18n.t('subscribe')}
</button>
)}
</div>