Skip to content

Commit

Permalink
Merge pull request #72 from tgxn/lower_class_changes
Browse files Browse the repository at this point in the history
these actions are whack
  • Loading branch information
tgxn authored Oct 24, 2023
2 parents d5cecf5 + e3db99b commit 3e92406
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 19 deletions.
44 changes: 28 additions & 16 deletions src/components/Activity/ModLogAccordians.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,18 @@ function ModDisplayName({ moderator }) {
);
}

import ForumIcon from "@mui/icons-material/Forum";
function RemovedPostRow({ item }) {
return (
<BaseAccordian
item={item}
tint="#a83a3a21"
headerIcon={<RemoveCircleOutlineIcon />}
tint={item.mod_remove_post.removed ? "#ff3e3e21" : "#08ba3a21"}
headerIcon={<ForumIcon />}
headerContent={
<>
<ModDisplayName moderator={item.moderator} /> removed post from {item.community.actor_id}{" "}
{item.mod_remove_post.reason ? `with reason: "${item.mod_remove_post.reason}"` : ""}
<ModDisplayName moderator={item.moderator} /> re{item.mod_remove_post.removed ? "moved" : "stored"}{" "}
post in {item.community.actor_id}
{item.mod_remove_post.reason ? ` with reason: "${item.mod_remove_post.reason}"` : ""}
</>
}
>
Expand Down Expand Up @@ -220,10 +222,12 @@ function LockedPostRow({ item }) {
return (
<BaseAccordian
item={item}
tint={item.mod_lock_post.locked ? "#ff3e3e21" : "#08ba3a21"}
headerIcon={<LockIcon />}
headerContent={
<>
<ModDisplayName moderator={item.moderator} /> locked post in {item.community.actor_id}
<ModDisplayName moderator={item.moderator} /> {item.mod_lock_post.locked ? "locked" : "unlocked"}{" "}
post in {item.community.actor_id}
</>
}
>
Expand Down Expand Up @@ -260,10 +264,12 @@ function AddedToCommunityRow({ item }) {
return (
<BaseAccordian
item={item}
tint={item.mod_add_community.removed ? "#ff3e3e21" : "#08ba3a21"}
headerIcon={<SwitchAccessShortcutAddIcon />}
headerContent={
<>
<ModDisplayName moderator={item.moderator} /> added to community {item.community.actor_id}
<ModDisplayName moderator={item.moderator} />{" "}
{item.mod_add_community.removed ? "removed from" : "added to"} community {item.community.actor_id}
</>
}
>
Expand All @@ -278,9 +284,11 @@ function FeaturedPostRow({ item }) {
<BaseAccordian
item={item}
headerIcon={<SwipeUpAltIcon />}
tint={!item.mod_feature_post.featured ? "#ff3e3e21" : "#08ba3a21"}
headerContent={
<>
<ModDisplayName moderator={item.moderator} /> featured post in {item.community.actor_id}
<ModDisplayName moderator={item.moderator} />{" "}
{item.mod_feature_post.featured ? "featured" : "unfeatured"} post in {item.community.actor_id}
</>
}
>
Expand Down Expand Up @@ -314,7 +322,8 @@ function TransferredToCommunityRow({ item }) {
headerIcon={<TransferWithinAStationIcon />}
headerContent={
<>
<ModDisplayName moderator={item.moderator} /> transferred community {item.community.actor_id}
<ModDisplayName moderator={item.moderator} /> modded person "{item.modded_person.actor_id}" in
community "{item.community.actor_id}"
</>
}
>
Expand All @@ -328,10 +337,12 @@ function AddedRow({ item }) {
return (
<BaseAccordian
item={item}
tint={item.mod_add.removed ? "#ff3e3e21" : "#08ba3a21"}
headerIcon={<PersonAddAlt1Icon />}
headerContent={
<>
<ModDisplayName moderator={item.moderator} /> added {item.modded_person.actor_id}
<ModDisplayName moderator={item.moderator} />{" "}
{item.mod_add.removed ? "removed admin from" : "gave admin to"} "{item.modded_person.actor_id}"
</>
}
>
Expand All @@ -348,7 +359,8 @@ function AdminPurgedPersonsRow({ item }) {
headerIcon={<SecurityIcon />}
headerContent={
<>
<ModDisplayName moderator={item.moderator} /> admin purged person {item.admin_purge_person.reason}
<ModDisplayName moderator={item.moderator} /> admin purged person{" "}
{item.admin_purge_person.reason ? ` with reason: "${item.admin_purge_person.reason}"` : ""}
</>
}
>
Expand All @@ -363,8 +375,8 @@ function AdminPurgedCommunitiesRow({ item }) {
headerIcon={<SecurityIcon />}
headerContent={
<>
<ModDisplayName moderator={item.moderator} /> admin purged community {item.admin_purge_community.id}
: "{item.admin_purge_community.reason}"
<ModDisplayName moderator={item.moderator} /> admin purged community {item.admin_purge_community.id}{" "}
{item.admin_purge_community.reason ? ` with reason: "${item.admin_purge_community.reason}"` : ""}
</>
}
>
Expand All @@ -379,8 +391,8 @@ function AdminPurgedPostsRow({ item }) {
headerIcon={<SecurityIcon />}
headerContent={
<>
<ModDisplayName moderator={item.moderator} /> admin purged posts {item.actorId} "
{item.admin_purge_post.reason}"
<ModDisplayName moderator={item.moderator} /> admin purged posts {item.actorId}{" "}
{item.admin_purge_post.reason ? ` with reason: "${item.admin_purge_post.reason}"` : ""}
</>
}
>
Expand All @@ -395,8 +407,8 @@ function AdminPurgedCommentsRow({ item }) {
headerIcon={<SecurityIcon />}
headerContent={
<>
<ModDisplayName moderator={item.moderator} /> admin purged comment "
{item.admin_purge_comment.reason}"
<ModDisplayName moderator={item.moderator} /> admin purged comment{" "}
{item.admin_purge_comment.reason ? ` with reason: "${item.admin_purge_comment.reason}"` : ""}
</>
}
>
Expand Down
7 changes: 4 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ export function getModLogTypeNames() {
added_to_community: "Adding Mod to Community",
transferred_to_community: "Transferring Communities",

added: "Adding Mod to Site",
added: "Site Admin Changes", // promote site admin

banned: "Mod Ban",
ModHideCommunity: "Mod Hide Community",
banned: "Site Bans", // ban user from site

// ModHideCommunity: "Mod Hide Community", // TODO doesn't seem used?

admin_purged_persons: "Admin Purge Person",
admin_purged_communities: "Admin Purge Community",
Expand Down

0 comments on commit 3e92406

Please sign in to comment.