From 68fa0e5e5c38919138e9ac4a7ba495cb961fdf7d Mon Sep 17 00:00:00 2001 From: Morian Engelhardt Date: Sat, 21 Oct 2023 17:42:50 +0200 Subject: [PATCH] feat(lb): remove arrows --- components/leaderboard-panel.tsx | 18 ------------------ context/user-context.tsx | 4 +++- models/backend/xp-models.ts | 2 -- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/components/leaderboard-panel.tsx b/components/leaderboard-panel.tsx index 0d61fdb..70f8a78 100644 --- a/components/leaderboard-panel.tsx +++ b/components/leaderboard-panel.tsx @@ -1,4 +1,3 @@ -import { useUser } from "context/user-context"; import useBreakpoints from "hooks/use-breakpoints"; import { isEqual } from "lodash"; import { IXPLeaderboardUser } from "models/backend/xp-models"; @@ -9,7 +8,6 @@ import { calculateLevel, formatNumber } from "utils/text-utils"; import BlockButton from "./block-button"; import FallBackImage from "./fallback-image"; -import { ArrowDown, ArrowUp, Neutral } from "./svg/arrows"; interface LeaderboardPanelProps { user: IXPLeaderboardUser; @@ -18,23 +16,12 @@ interface LeaderboardPanelProps { isAdmin?: boolean; } -const getArrowPos = (id: string, arrPos: number, pos: number) => { - return arrPos < pos ? ( - - ) : arrPos > pos ? ( - - ) : ( - - ); -}; - const LeaderboardPanel: FC = ({ user, rank, requestEdit, isAdmin, }) => { - const userContext = useUser(); const [hovering, setHovering] = useState(false); const breakpoints = useBreakpoints(); hovering; @@ -85,11 +72,6 @@ const LeaderboardPanel: FC = ({
{formatNumber(user.xp)} xp
- {!userContext.flags?.["disable-leaderboard-arrows"] && ( -
- {getArrowPos(user.id, user.arrowPos, rank)} -
- )} {isAdmin && ( (); - const { flags } = useFlags(); + const { flags } = useFlags( + currentUser ? { user: { key: currentUser?.discordUser.id } } : undefined + ); const [inboxItems, setInboxItems] = useState([]); diff --git a/models/backend/xp-models.ts b/models/backend/xp-models.ts index 3c2834c..b6c4dbc 100644 --- a/models/backend/xp-models.ts +++ b/models/backend/xp-models.ts @@ -40,7 +40,6 @@ export interface IXPGuild { allowed: Array; }>; }; - arrows: { [id: string]: number }; leaderboard_message: { enabled: boolean; messageID: string; @@ -126,7 +125,6 @@ export interface IXPLeaderboardGuild { export interface IXPLeaderboardUser { id: string; xp: number; - arrowPos: number; username: string; avatar?: string; banner?: string;