X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fperson%2Fprofile.tsx;h=d493f787d5602240ef2b0bfc339315da72863a10;hb=53c3cfeade90150b07431386745a24aa699a25ec;hp=86b01d5805033ac89e9fba8dd2d7bae00a5f59c3;hpb=93d2d56cceaf4f6fdfe13d7b8c9a5a471e24b39f;p=lemmy-ui.git diff --git a/src/shared/components/person/profile.tsx b/src/shared/components/person/profile.tsx index 86b01d5..d493f78 100644 --- a/src/shared/components/person/profile.tsx +++ b/src/shared/components/person/profile.tsx @@ -5,7 +5,6 @@ import { enableDownvotes, enableNsfw, getCommentParentId, - getRoleLabelPill, myAuth, myAuthRequired, setIsoData, @@ -19,6 +18,7 @@ import { getQueryParams, getQueryString, numToSI, + randomStr, } from "@utils/helpers"; import { canMod, isAdmin, isBanned } from "@utils/roles"; import type { QueryParams } from "@utils/types"; @@ -85,6 +85,7 @@ import { HtmlTags } from "../common/html-tags"; import { Icon, Spinner } from "../common/icon"; import { MomentTime } from "../common/moment-time"; import { SortSelect } from "../common/sort-select"; +import { UserBadges } from "../common/user-badges"; import { CommunityLink } from "../community/community-link"; import { PersonDetails } from "./person-details"; import { PersonListing } from "./person-listing"; @@ -232,7 +233,7 @@ export class Profile extends Component< async fetchUserData() { const { page, sort, view } = getProfileQueryParams(); - this.setState({ personRes: { state: "empty" } }); + this.setState({ personRes: { state: "loading" } }); this.setState({ personRes: await HttpService.client.getPersonDetails({ username: this.props.match.params.username, @@ -323,6 +324,7 @@ export class Profile extends Component< @@ -397,7 +399,7 @@ export class Profile extends Component< get viewRadios() { return ( -
+
{this.getRadio(PersonDetailsView.Overview)} {this.getRadio(PersonDetailsView.Comments)} {this.getRadio(PersonDetailsView.Posts)} @@ -409,22 +411,27 @@ export class Profile extends Component< getRadio(view: PersonDetailsView) { const { view: urlView } = getProfileQueryParams(); const active = view === urlView; + const radioId = randomStr(); return ( - + + ); } @@ -484,46 +491,15 @@ export class Profile extends Component< hideAvatar /> - {isBanned(pv.person) && ( -
  • - {getRoleLabelPill({ - label: I18NextService.i18n.t("banned"), - tooltip: I18NextService.i18n.t("banned"), - classes: "text-bg-danger", - shrink: false, - })} -
  • - )} - {pv.person.deleted && ( -
  • - {getRoleLabelPill({ - label: I18NextService.i18n.t("deleted"), - tooltip: I18NextService.i18n.t("deleted"), - classes: "text-bg-danger", - shrink: false, - })} -
  • - )} - {pv.person.admin && ( -
  • - {getRoleLabelPill({ - label: I18NextService.i18n.t("admin"), - tooltip: I18NextService.i18n.t("admin"), - shrink: false, - })} -
  • - )} - {pv.person.bot_account && ( -
  • - {getRoleLabelPill({ - label: I18NextService.i18n - .t("bot_account") - .toLowerCase(), - tooltip: I18NextService.i18n.t("bot_account"), - shrink: false, - })} -
  • - )} +
  • + +
  • {this.banDialog(pv)}