From 5863c4030631c9e6c6e85cd023413c78b14054d4 Mon Sep 17 00:00:00 2001 From: Djordje Vlaisavljevic Date: Wed, 13 Nov 2024 11:45:37 +0000 Subject: [PATCH] Improved Inbox view UI (#21600) ref https://linear.app/ghost/issue/AP-521/improve-inbox-view-alignmentstructure - Improved the layout, spacing and typography of Inbox view - Removed attachment counters for images in Inbox view - Added a very very small variant of `APAvatar` --- .../src/components/Inbox.tsx | 6 +- .../src/components/feed/FeedItem.tsx | 55 +++++++------------ .../src/components/global/APAvatar.tsx | 7 ++- 3 files changed, 30 insertions(+), 38 deletions(-) diff --git a/apps/admin-x-activitypub/src/components/Inbox.tsx b/apps/admin-x-activitypub/src/components/Inbox.tsx index 871055c030..a97f280d74 100644 --- a/apps/admin-x-activitypub/src/components/Inbox.tsx +++ b/apps/admin-x-activitypub/src/components/Inbox.tsx @@ -76,9 +76,9 @@ const Inbox: React.FC = ({}) => { ) : activities.length > 0 ? ( <> -
+
-
    +
      {activities.map((activity, index) => (
    • = ({}) => { )}
-
+

You might also like...

{isLoadingSuggested ? ( diff --git a/apps/admin-x-activitypub/src/components/feed/FeedItem.tsx b/apps/admin-x-activitypub/src/components/feed/FeedItem.tsx index a5af5ad65e..68c87625b3 100644 --- a/apps/admin-x-activitypub/src/components/feed/FeedItem.tsx +++ b/apps/admin-x-activitypub/src/components/feed/FeedItem.tsx @@ -5,6 +5,7 @@ import {Button, Heading, Icon, Menu, MenuItem, showToast} from '@tryghost/admin- import APAvatar from '../global/APAvatar'; import FeedItemStats from './FeedItemStats'; +import clsx from 'clsx'; import getRelativeTimestamp from '../../utils/get-relative-timestamp'; import getUsername from '../../utils/get-username'; import stripHtml from '../../utils/strip-html'; @@ -83,7 +84,7 @@ export function renderFeedAttachment(object: ObjectProperties, layout: string) {
; default: if (object.image) { - return attachment; + return attachment; } return null; } @@ -92,20 +93,16 @@ export function renderFeedAttachment(object: ObjectProperties, layout: string) { function renderInboxAttachment(object: ObjectProperties) { const attachment = getAttachment(object); + const videoAttachmentStyles = 'ml-8 shrink-0 rounded-md h-[80px] w-[120px] relative'; + const imageAttachmentStyles = clsx('object-cover outline outline-1 -outline-offset-1 outline-black/[0.05]', videoAttachmentStyles); + if (!attachment) { return null; } if (Array.isArray(attachment)) { - const attachmentCount = attachment.length; - return ( -
-
- -
+ {attachmentCount - 1}
-
-
+ ); } @@ -114,14 +111,12 @@ function renderInboxAttachment(object: ObjectProperties) { case 'image/png': case 'image/gif': return ( -
- -
+ ); case 'video/mp4': case 'video/webm': return ( -
+