Fix broken profile page, and missing sidebars.

This commit is contained in:
Dessalines 2022-09-23 00:38:37 -04:00
parent c22a71ea82
commit 554d4421f5

View file

@ -129,8 +129,6 @@ export class Profile extends Component<any, ProfileState> {
} else { } else {
this.fetchUserData(); this.fetchUserData();
} }
this.setPersonBlock();
} }
fetchUserData() { fetchUserData() {
@ -209,6 +207,7 @@ export class Profile extends Component<any, ProfileState> {
} }
componentDidMount() { componentDidMount() {
this.setPersonBlock();
setupTippy(); setupTippy();
} }
@ -413,9 +412,12 @@ export class Profile extends Component<any, ProfileState> {
<div className=""> <div className="">
<div className="mb-0 d-flex flex-wrap"> <div className="mb-0 d-flex flex-wrap">
<div> <div>
{pv.person.display_name && ( {pv.person.display_name.match({
<h5 className="mb-0">{pv.person.display_name}</h5> some: displayName => (
)} <h5 className="mb-0">{displayName}</h5>
),
none: <></>,
})}
<ul className="list-inline mb-2"> <ul className="list-inline mb-2">
<li className="list-inline-item"> <li className="list-inline-item">
<PersonListing <PersonListing
@ -662,25 +664,28 @@ export class Profile extends Component<any, ProfileState> {
}); });
} }
// TODO test this, make sure its good
moderates() { moderates() {
return this.state.personRes return this.state.personRes
.map(r => r.moderates) .map(r => r.moderates)
.match({ .match({
some: moderates => { some: moderates => {
if (moderates.length > 0) { if (moderates.length > 0) {
<div className="card border-secondary mb-3"> return (
<div className="card-body"> <div className="card border-secondary mb-3">
<h5>{i18n.t("moderates")}</h5> <div className="card-body">
<ul className="list-unstyled mb-0"> <h5>{i18n.t("moderates")}</h5>
{moderates.map(cmv => ( <ul className="list-unstyled mb-0">
<li key={cmv.community.id}> {moderates.map(cmv => (
<CommunityLink community={cmv.community} /> <li key={cmv.community.id}>
</li> <CommunityLink community={cmv.community} />
))} </li>
</ul> ))}
</ul>
</div>
</div> </div>
</div>; );
} else {
return <></>;
} }
}, },
none: void 0, none: void 0,
@ -693,18 +698,22 @@ export class Profile extends Component<any, ProfileState> {
.match({ .match({
some: follows => { some: follows => {
if (follows.length > 0) { if (follows.length > 0) {
<div className="card border-secondary mb-3"> return (
<div className="card-body"> <div className="card border-secondary mb-3">
<h5>{i18n.t("subscribed")}</h5> <div className="card-body">
<ul className="list-unstyled mb-0"> <h5>{i18n.t("subscribed")}</h5>
{follows.map(cfv => ( <ul className="list-unstyled mb-0">
<li key={cfv.community.id}> {follows.map(cfv => (
<CommunityLink community={cfv.community} /> <li key={cfv.community.id}>
</li> <CommunityLink community={cfv.community} />
))} </li>
</ul> ))}
</ul>
</div>
</div> </div>
</div>; );
} else {
return <></>;
} }
}, },
none: void 0, none: void 0,