mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 18:06:22 +00:00
refactor(betterActivities): ActivityTooltip as function component
This commit is contained in:
parent
265a9755b3
commit
46facce4b7
1 changed files with 9 additions and 4 deletions
|
@ -26,7 +26,14 @@ const TimeBar = findComponentByCodeLazy<{
|
||||||
className: string;
|
className: string;
|
||||||
}>("isSingleLine");
|
}>("isSingleLine");
|
||||||
|
|
||||||
const ActivityTooltip = ({ activity, application, user, cl }: Readonly<{ activity: Activity, application?: Application, user: User; cl: ReturnType<typeof classNameFactory> }>) => {
|
interface ActivityTooltipProps {
|
||||||
|
activity: Activity;
|
||||||
|
application?: Application;
|
||||||
|
user: User;
|
||||||
|
cl: ReturnType<typeof classNameFactory>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function ActivityTooltip({ activity, application, user, cl }: Readonly<ActivityTooltipProps>) {
|
||||||
const image = useMemo(() => {
|
const image = useMemo(() => {
|
||||||
const activityImage = getActivityImage(activity, application);
|
const activityImage = getActivityImage(activity, application);
|
||||||
if (activityImage) {
|
if (activityImage) {
|
||||||
|
@ -64,6 +71,4 @@ const ActivityTooltip = ({ activity, application, user, cl }: Readonly<{ activit
|
||||||
</div>
|
</div>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
export default ActivityTooltip;
|
|
||||||
|
|
Loading…
Reference in a new issue