Adding creator_banned_from_community to view votes modal. (#2435)

* Adding creator_banned_from_community to view votes modal.

* Adding margin.

* Updating pnpm to 9.0.5
This commit is contained in:
Dessalines 2024-04-23 21:58:52 -04:00 committed by GitHub
parent c1b8946875
commit b2a3f29fe2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 13 additions and 14 deletions

View file

@ -141,7 +141,7 @@
"sortpack"
]
},
"packageManager": "pnpm@9.0.1+sha256.46d50ee2afecb42b185ebbd662dc7bdd52ef5be56bf035bb615cab81a75345df",
"packageManager": "pnpm@9.0.5+sha256.61bd66913b52012107ec25a6ee4d6a161021ab99e04f6acee3aa50d0e34b4af9",
"engineStrict": true,
"importSort": {
".js, .jsx, .ts, .tsx": {

View file

@ -10,7 +10,6 @@ import {
amMod,
canAdmin,
canMod,
isBanned,
} from "@utils/roles";
import ActionButton from "./action-button";
import classNames from "classnames";
@ -154,7 +153,7 @@ export default class ContentActionDropdown extends Component<
type === "post"
? `post-actions-dropdown-${id}`
: `comment-actions-dropdown-${id}`;
const creatorBannedFromLocal = isBanned(creator);
const creatorBannedFromLocal = creator.banned;
const showToggleAdmin = !creatorBannedFromLocal && creator.local;
const canAppointCommunityMod =
(amMod(community.id) || (amAdmin() && community.local)) &&

View file

@ -23,6 +23,7 @@ import {
import { fetchLimit } from "../../config";
import { PersonListing } from "../person/person-listing";
import { modalMixin } from "../mixins/modal-mixin";
import { UserBadges } from "./user-badges";
interface ViewVotesModalProps {
children?: InfernoNode;
@ -47,6 +48,12 @@ function voteViewTable(votes: VoteView[]) {
<tr key={v.creator.id}>
<td className="text-start">
<PersonListing person={v.creator} useApubName />
<UserBadges
classNames="ms-1"
isBot={v.creator.bot_account}
isDeleted={v.creator.deleted}
isBanned={v.creator.banned || v.creator_banned_from_community}
/>
</td>
<td className="text-end">{scoreToIcon(v.score)}</td>
</tr>

View file

@ -20,7 +20,7 @@ import {
randomStr,
resourcesSettled,
} from "@utils/helpers";
import { canMod, isBanned } from "@utils/roles";
import { canMod } from "@utils/roles";
import type { QueryParams } from "@utils/types";
import { RouteDataResponse } from "@utils/types";
import classNames from "classnames";
@ -542,7 +542,7 @@ export class Profile extends Component<ProfileRouteProps, ProfileState> {
return (
pv && (
<div>
{!isBanned(pv.person) && (
{!pv.person.banned && (
<BannerIconHeader
banner={pv.person.banner}
icon={pv.person.avatar}
@ -568,7 +568,7 @@ export class Profile extends Component<ProfileRouteProps, ProfileState> {
<li className="list-inline-item">
<UserBadges
classNames="ms-1"
isBanned={isBanned(pv.person)}
isBanned={pv.person.banned}
isDeleted={pv.person.deleted}
isAdmin={pv.is_admin}
isBot={pv.person.bot_account}
@ -628,7 +628,7 @@ export class Profile extends Component<ProfileRouteProps, ProfileState> {
{canMod(pv.person.id, undefined, admins) &&
!pv.is_admin &&
!showBanDialog &&
(!isBanned(pv.person) ? (
(!pv.person.banned ? (
<button
className={
"d-flex align-self-start btn btn-secondary me-2"

View file

@ -6,7 +6,6 @@ import amTopMod from "./am-top-mod";
import canAdmin from "./can-admin";
import canCreateCommunity from "./can-create-community";
import canMod from "./can-mod";
import isBanned from "./is-banned";
export {
amAdmin,
@ -17,5 +16,4 @@ export {
canAdmin,
canCreateCommunity,
canMod,
isBanned,
};

View file

@ -1,5 +0,0 @@
import { Person } from "lemmy-js-client";
export default function isBanned(ps: Person): boolean {
return ps.banned;
}