diff --git a/apps/admin-x-activitypub/src/components/Activities.tsx b/apps/admin-x-activitypub/src/components/Activities.tsx index 348410b287..9f784beed2 100644 --- a/apps/admin-x-activitypub/src/components/Activities.tsx +++ b/apps/admin-x-activitypub/src/components/Activities.tsx @@ -1,4 +1,4 @@ -import APAvatar from './global/APAvatar'; +import APAvatar, {AvatarBadge} from './global/APAvatar'; import ActivityItem from './activities/ActivityItem'; import MainNavigation from './navigation/MainNavigation'; import React from 'react'; @@ -60,6 +60,25 @@ const getActivityUrl = (activity: Activity): string | null => { return null; }; +const getActorUrl = (activity: Activity): string | null => { + if (activity.actor) { + return activity.actor.url; + } + + return null; +}; + +const getActivityBadge = (activity: Activity): AvatarBadge => { + switch (activity.type) { + case ACTVITY_TYPE.FOLLOW: + return 'user-fill'; + case ACTVITY_TYPE.LIKE: + if (activity.object) { + return 'heart-fill'; + } + } +}; + const isFollower = (id: string, followerIds: string[]): boolean => { return followerIds.includes(id); }; @@ -85,8 +104,8 @@ const Activities: React.FC = ({}) => { {activities.length > 0 && (
{activities?.map(activity => ( - - + +
{activity.actor.name} diff --git a/apps/admin-x-activitypub/src/components/activities/ActivityItem.tsx b/apps/admin-x-activitypub/src/components/activities/ActivityItem.tsx index ee17d69d80..6db9b4186c 100644 --- a/apps/admin-x-activitypub/src/components/activities/ActivityItem.tsx +++ b/apps/admin-x-activitypub/src/components/activities/ActivityItem.tsx @@ -17,7 +17,7 @@ const ActivityItem: React.FC = ({children, url = null}) => { const Item = (
-
+
{childrenArray[0]} {childrenArray[1]} {childrenArray[2]}