mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 09:56:24 +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;
|
||||
}>("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 activityImage = getActivityImage(activity, application);
|
||||
if (activityImage) {
|
||||
|
@ -64,6 +71,4 @@ const ActivityTooltip = ({ activity, application, user, cl }: Readonly<{ activit
|
|||
</div>
|
||||
</ErrorBoundary>
|
||||
);
|
||||
};
|
||||
|
||||
export default ActivityTooltip;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue