const myUSerInfo = UserService.Instance.myUserInfo;
const { name, actor_id } = this.props.community_view.community;
return (
- <div id="sidebarContainer">
- <section id="sidebarMain" className="card border-secondary mb-3">
- <div className="card-body">
- {this.communityTitle()}
- {this.props.editable && this.adminButtons()}
- {myUSerInfo && this.subscribe()}
- {this.canPost && this.createPost()}
- {myUSerInfo && this.blockCommunity()}
- {!myUSerInfo && (
- <div className="alert alert-info" role="alert">
- <T
- i18nKey="community_not_logged_in_alert"
- interpolation={{
- community: name,
- instance: hostname(actor_id),
- }}
- >
- #<code className="user-select-all">#</code>#
- </T>
- </div>
- )}
- </div>
- </section>
- <section id="sidebarInfo" className="card border-secondary mb-3">
- <div className="card-body">
- {this.description()}
- {this.badges()}
- {this.mods()}
- </div>
- </section>
- </div>
+ <aside className="mb-3">
+ <div id="sidebarContainer">
+ <section id="sidebarMain" className="card border-secondary mb-3">
+ <div className="card-body">
+ {this.communityTitle()}
+ {this.props.editable && this.adminButtons()}
+ {myUSerInfo && this.subscribe()}
+ {this.canPost && this.createPost()}
+ {myUSerInfo && this.blockCommunity()}
+ {!myUSerInfo && (
+ <div className="alert alert-info" role="alert">
+ <T
+ i18nKey="community_not_logged_in_alert"
+ interpolation={{
+ community: name,
+ instance: hostname(actor_id),
+ }}
+ >
+ #<code className="user-select-all">#</code>#
+ </T>
+ </div>
+ )}
+ </div>
+ </section>
+ <section id="sidebarInfo" className="card border-secondary mb-3">
+ <div className="card-body">
+ {this.description()}
+ {this.badges()}
+ {this.mods()}
+ </div>
+ </section>
+ </div>
+ </aside>
);
}
const res = this.state.postRes;
if (res.state === "success") {
return (
- <aside className="mb-3">
- <Sidebar
- community_view={res.data.community_view}
- moderators={res.data.moderators}
- admins={this.state.siteRes.admins}
- enableNsfw={enableNsfw(this.state.siteRes)}
- showIcon
- allLanguages={this.state.siteRes.all_languages}
- siteLanguages={this.state.siteRes.discussion_languages}
- onDeleteCommunity={this.handleDeleteCommunityClick}
- onLeaveModTeam={this.handleAddModToCommunity}
- onFollowCommunity={this.handleFollow}
- onRemoveCommunity={this.handleModRemoveCommunity}
- onPurgeCommunity={this.handlePurgeCommunity}
- onBlockCommunity={this.handleBlockCommunity}
- onEditCommunity={this.handleEditCommunity}
- />
- </aside>
+ <Sidebar
+ community_view={res.data.community_view}
+ moderators={res.data.moderators}
+ admins={this.state.siteRes.admins}
+ enableNsfw={enableNsfw(this.state.siteRes)}
+ showIcon
+ allLanguages={this.state.siteRes.all_languages}
+ siteLanguages={this.state.siteRes.discussion_languages}
+ onDeleteCommunity={this.handleDeleteCommunityClick}
+ onLeaveModTeam={this.handleAddModToCommunity}
+ onFollowCommunity={this.handleFollow}
+ onRemoveCommunity={this.handleModRemoveCommunity}
+ onPurgeCommunity={this.handlePurgeCommunity}
+ onBlockCommunity={this.handleBlockCommunity}
+ onEditCommunity={this.handleEditCommunity}
+ />
);
}
}