From 58eb7943dbb629f5b8e697e35e87ca3cf3b79f94 Mon Sep 17 00:00:00 2001 From: D3SOX Date: Mon, 6 May 2024 20:27:16 +0200 Subject: [PATCH] refactor(betterActivities): add type for ActivityView component --- src/plugins/betterActivities/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/betterActivities/index.tsx b/src/plugins/betterActivities/index.tsx index 23ae64daa..f6b35ebff 100644 --- a/src/plugins/betterActivities/index.tsx +++ b/src/plugins/betterActivities/index.tsx @@ -23,7 +23,7 @@ import { classNameFactory } from "@api/Styles"; import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; -import { findByCodeLazy, findByPropsLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack"; +import { findByPropsLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack"; import { moment, PresenceStore, React, Tooltip, useMemo, useStateFromStores } from "@webpack/common"; import { Guild, User } from "discord-types/general"; @@ -83,7 +83,13 @@ const TimeBar = findComponentByCodeLazy<{ className: string; }>("isSingleLine"); -const ActivityView = findByCodeLazy("onOpenGameProfile:"); +const ActivityView = findComponentByCodeLazy<{ + activity: Activity | null; + user: User; + guild: Guild; + channelId: string; + onClose: () => void; + }>("onOpenGameProfile:"); // if discord one day decides to change their icon this needs to be updated const DefaultActivityIcon = findComponentByCodeLazy("M6,7 L2,7 L2,6 L6,6 L6,7 Z M8,5 L2,5 L2,4 L8,4 L8,5 Z M8,3 L2,3 L2,2 L8,2 L8,3 Z M8.88888889,0 L1.11111111,0 C0.494444444,0 0,0.494444444 0,1.11111111 L0,8.88888889 C0,9.50253861 0.497461389,10 1.11111111,10 L8.88888889,10 C9.50253861,10 10,9.50253861 10,8.88888889 L10,1.11111111 C10,0.494444444 9.5,0 8.88888889,0 Z");