From 32b32aa1643fb94e01da2555b70fa5efc2a8b89d Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 23 Sep 2022 00:41:04 -0400 Subject: [PATCH] Fix broken profile page, and missing sidebars. (#795) --- src/shared/components/person/profile.tsx | 65 ++++++++++++++---------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/src/shared/components/person/profile.tsx b/src/shared/components/person/profile.tsx index b938728..52e7a93 100644 --- a/src/shared/components/person/profile.tsx +++ b/src/shared/components/person/profile.tsx @@ -129,8 +129,6 @@ export class Profile extends Component { } else { this.fetchUserData(); } - - this.setPersonBlock(); } fetchUserData() { @@ -209,6 +207,7 @@ export class Profile extends Component { } componentDidMount() { + this.setPersonBlock(); setupTippy(); } @@ -413,9 +412,12 @@ export class Profile extends Component {
- {pv.person.display_name && ( -
{pv.person.display_name}
- )} + {pv.person.display_name.match({ + some: displayName => ( +
{displayName}
+ ), + none: <>, + })}
  • { }); } - // TODO test this, make sure its good moderates() { return this.state.personRes .map(r => r.moderates) .match({ some: moderates => { if (moderates.length > 0) { -
    -
    -
    {i18n.t("moderates")}
    -
      - {moderates.map(cmv => ( -
    • - -
    • - ))} -
    + return ( +
    +
    +
    {i18n.t("moderates")}
    +
      + {moderates.map(cmv => ( +
    • + +
    • + ))} +
    +
    -
    ; + ); + } else { + return <>; } }, none: void 0, @@ -693,18 +698,22 @@ export class Profile extends Component { .match({ some: follows => { if (follows.length > 0) { -
    -
    -
    {i18n.t("subscribed")}
    -
      - {follows.map(cfv => ( -
    • - -
    • - ))} -
    + return ( +
    +
    +
    {i18n.t("subscribed")}
    +
      + {follows.map(cfv => ( +
    • + +
    • + ))} +
    +
    -
    ; + ); + } else { + return <>; } }, none: void 0, -- 2.44.1