Skip to content

Commit 2a48087

Browse files
committed
Move moderator-badge frontend changes to a separate PR
The badge-explorer hide and profile guard now live in #8766; this branch keeps only the backend gating.
1 parent d343a1f commit 2a48087

2 files changed

Lines changed: 7 additions & 19 deletions

File tree

app/web/features/badges/BadgesPage.tsx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
import CenteredSpinner from "components/CenteredSpinner/CenteredSpinner";
1010
import HtmlMeta from "components/HtmlMeta";
1111
import PageTitle from "components/PageTitle";
12-
import { useFeatureValue } from "experimentation";
1312
import Badge from "features/badges/Badge";
1413
import { useBadges } from "features/badges/hooks";
1514
import { useTranslation } from "i18n";
@@ -63,12 +62,6 @@ export default function BadgesPage({ badgeId = undefined }: BadgesPageProps) {
6362

6463
const isMobile = useMediaQuery(theme.breakpoints.down("md"));
6564

66-
// the catalog still lists the moderator badge; the award job stops granting it once
67-
// show_moderator_badge is off, so hide it from the explorer to match.
68-
const showModeratorBadge = useFeatureValue("show_moderator_badge", true);
69-
const isHiddenBadge = (badgeId: string) =>
70-
badgeId === "moderator" && !showModeratorBadge;
71-
7265
return (
7366
<>
7467
<HtmlMeta title={t("global:nav.badges")} />
@@ -80,13 +73,11 @@ export default function BadgesPage({ badgeId = undefined }: BadgesPageProps) {
8073
<ParentFlexDiv>
8174
<div>
8275
{badges &&
83-
Object.values(badges)
84-
.filter((badge) => !isHiddenBadge(badge.id))
85-
.map((badge) => (
86-
<BadgeListItem key={badge.id}>
87-
<Badge badge={badge} />
88-
</BadgeListItem>
89-
))}
76+
Object.values(badges).map((badge) => (
77+
<BadgeListItem key={badge.id}>
78+
<Badge badge={badge} />
79+
</BadgeListItem>
80+
))}
9081
</div>
9182
<StyledDivider
9283
orientation={isMobile ? "horizontal" : "vertical"}
@@ -96,7 +87,7 @@ export default function BadgesPage({ badgeId = undefined }: BadgesPageProps) {
9687
<ContentDiv>
9788
{isBadgesLoading ? (
9889
<CenteredSpinner />
99-
) : badges && badgeId in badges && !isHiddenBadge(badgeId) ? (
90+
) : badges && badgeId in badges ? (
10091
<>
10192
<FlexDiv>
10293
<Badge badge={badges[badgeId]} />

app/web/features/profile/view/Badges.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ export const Badges = ({ user }: Props) => {
2121
return (
2222
<StyledContainer>
2323
{(user.badgesList || []).map((badgeId) => {
24-
const badge = badges[badgeId];
25-
if (!badge) {
26-
return null;
27-
}
24+
const badge = (badges || {})[badgeId];
2825
return <Badge key={badge.id} badge={badge} />;
2926
})}
3027
</StyledContainer>

0 commit comments

Comments
 (0)