|
|
@ -13,6 +13,7 @@ import {
|
|
|
|
getUnixTime,
|
|
|
|
getUnixTime,
|
|
|
|
pictshareAvatarThumbnail,
|
|
|
|
pictshareAvatarThumbnail,
|
|
|
|
showAvatars,
|
|
|
|
showAvatars,
|
|
|
|
|
|
|
|
setupTippy,
|
|
|
|
} from '../utils';
|
|
|
|
} from '../utils';
|
|
|
|
import { CommunityForm } from './community-form';
|
|
|
|
import { CommunityForm } from './community-form';
|
|
|
|
import { i18n } from '../i18next';
|
|
|
|
import { i18n } from '../i18next';
|
|
|
@ -46,6 +47,10 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
|
|
|
|
this.handleEditCancel = this.handleEditCancel.bind(this);
|
|
|
|
this.handleEditCancel = this.handleEditCancel.bind(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidUpdate() {
|
|
|
|
|
|
|
|
setupTippy();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
@ -84,26 +89,37 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
|
|
|
|
<Link className="text-muted" to={`/c/${community.name}`}>
|
|
|
|
<Link className="text-muted" to={`/c/${community.name}`}>
|
|
|
|
/c/{community.name}
|
|
|
|
/c/{community.name}
|
|
|
|
</Link>
|
|
|
|
</Link>
|
|
|
|
<ul class="list-inline mb-1 text-muted small font-weight-bold">
|
|
|
|
<ul class="list-inline mb-1 text-muted font-weight-bold">
|
|
|
|
{this.canMod && (
|
|
|
|
{this.canMod && (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
<li className="list-inline-item">
|
|
|
|
<li className="list-inline-item-action">
|
|
|
|
<span
|
|
|
|
<span
|
|
|
|
class="pointer"
|
|
|
|
class="pointer"
|
|
|
|
onClick={linkEvent(this, this.handleEditClick)}
|
|
|
|
onClick={linkEvent(this, this.handleEditClick)}
|
|
|
|
|
|
|
|
data-tippy-content={i18n.t('edit')}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{i18n.t('edit')}
|
|
|
|
<svg class="icon icon-inline">
|
|
|
|
|
|
|
|
<use xlinkHref="#icon-edit"></use>
|
|
|
|
|
|
|
|
</svg>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
{this.amCreator && (
|
|
|
|
{this.amCreator && (
|
|
|
|
<li className="list-inline-item">
|
|
|
|
<li className="list-inline-item-action">
|
|
|
|
<span
|
|
|
|
<span
|
|
|
|
class="pointer"
|
|
|
|
class="pointer"
|
|
|
|
onClick={linkEvent(this, this.handleDeleteClick)}
|
|
|
|
onClick={linkEvent(this, this.handleDeleteClick)}
|
|
|
|
>
|
|
|
|
data-tippy-content={
|
|
|
|
{!community.deleted
|
|
|
|
!community.deleted
|
|
|
|
? i18n.t('delete')
|
|
|
|
? i18n.t('delete')
|
|
|
|
: i18n.t('restore')}
|
|
|
|
: i18n.t('restore')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<svg
|
|
|
|
|
|
|
|
class={`icon icon-inline ${community.deleted &&
|
|
|
|
|
|
|
|
'text-danger'}`}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<use xlinkHref="#icon-trash"></use>
|
|
|
|
|
|
|
|
</svg>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|