} else {
this.fetchUserData();
}
-
- this.setPersonBlock();
}
fetchUserData() {
}
componentDidMount() {
+ this.setPersonBlock();
setupTippy();
}
}
get documentTitle(): string {
- return this.state.siteRes.site_view.match({
- some: siteView =>
- this.state.personRes.match({
- some: res =>
- `@${res.person_view.person.name} - ${siteView.site.name}`,
- none: "",
- }),
+ return this.state.personRes.match({
+ some: res =>
+ `@${res.person_view.person.name} - ${this.state.siteRes.site_view.site.name}`,
none: "",
});
}
render() {
return (
- <div className="container">
+ <div className="container-lg">
{this.state.loading ? (
<h5>
<Spinner large />
enableNsfw={enableNsfw(this.state.siteRes)}
view={this.state.view}
onPageChange={this.handlePageChange}
+ allLanguages={this.state.siteRes.all_languages}
+ siteLanguages={this.state.siteRes.discussion_languages}
/>
</div>
<div className="">
<div className="mb-0 d-flex flex-wrap">
<div>
- {pv.person.display_name && (
- <h5 className="mb-0">{pv.person.display_name}</h5>
- )}
+ {pv.person.display_name.match({
+ some: displayName => (
+ <h5 className="mb-0">{displayName}</h5>
+ ),
+ none: <></>,
+ })}
<ul className="list-inline mb-2">
<li className="list-inline-item">
<PersonListing
{i18n.t("banned")}
</li>
)}
+ {pv.person.deleted && (
+ <li className="list-inline-item badge badge-danger">
+ {i18n.t("deleted")}
+ </li>
+ )}
{pv.person.admin && (
<li className="list-inline-item badge badge-light">
{i18n.t("admin")}
});
}
- // TODO test this, make sure its good
moderates() {
return this.state.personRes
.map(r => r.moderates)
.match({
some: moderates => {
if (moderates.length > 0) {
- <div className="card border-secondary mb-3">
- <div className="card-body">
- <h5>{i18n.t("moderates")}</h5>
- <ul className="list-unstyled mb-0">
- {moderates.map(cmv => (
- <li key={cmv.community.id}>
- <CommunityLink community={cmv.community} />
- </li>
- ))}
- </ul>
+ return (
+ <div className="card border-secondary mb-3">
+ <div className="card-body">
+ <h5>{i18n.t("moderates")}</h5>
+ <ul className="list-unstyled mb-0">
+ {moderates.map(cmv => (
+ <li key={cmv.community.id}>
+ <CommunityLink community={cmv.community} />
+ </li>
+ ))}
+ </ul>
+ </div>
</div>
- </div>;
+ );
+ } else {
+ return <></>;
}
},
none: void 0,
.match({
some: follows => {
if (follows.length > 0) {
- <div className="card border-secondary mb-3">
- <div className="card-body">
- <h5>{i18n.t("subscribed")}</h5>
- <ul className="list-unstyled mb-0">
- {follows.map(cfv => (
- <li key={cfv.community.id}>
- <CommunityLink community={cfv.community} />
- </li>
- ))}
- </ul>
+ return (
+ <div className="card border-secondary mb-3">
+ <div className="card-body">
+ <h5>{i18n.t("subscribed")}</h5>
+ <ul className="list-unstyled mb-0">
+ {follows.map(cfv => (
+ <li key={cfv.community.id}>
+ <CommunityLink community={cfv.community} />
+ </li>
+ ))}
+ </ul>
+ </div>
</div>
- </div>;
+ );
+ } else {
+ return <></>;
}
},
none: void 0,
op == UserOperation.DeletePost ||
op == UserOperation.RemovePost ||
op == UserOperation.LockPost ||
- op == UserOperation.StickyPost ||
+ op == UserOperation.FeaturePost ||
op == UserOperation.SavePost
) {
let data = wsJsonToRes<PostResponse>(msg, PostResponse);