From 6530cd535e86eabdc61c4790a0a9593141831744 Mon Sep 17 00:00:00 2001 From: Peter Zimon Date: Thu, 22 Aug 2024 14:12:24 +0200 Subject: [PATCH] Added basic inbox view --- .../src/components/Inbox.tsx | 41 +++- .../src/components/feed/FeedItem.tsx | 205 +++++++++++++++--- .../src/components/global/APAvatar.tsx | 19 +- .../src/global/Tooltip.tsx | 2 +- 4 files changed, 222 insertions(+), 45 deletions(-) diff --git a/apps/admin-x-activitypub/src/components/Inbox.tsx b/apps/admin-x-activitypub/src/components/Inbox.tsx index 0f7e17441d..e49eab6545 100644 --- a/apps/admin-x-activitypub/src/components/Inbox.tsx +++ b/apps/admin-x-activitypub/src/components/Inbox.tsx @@ -6,7 +6,7 @@ import NiceModal from '@ebay/nice-modal-react'; import React, {useState} from 'react'; import {Activity} from './activities/ActivityItem'; import {ActorProperties, ObjectProperties} from '@tryghost/admin-x-framework/api/activitypub'; -import {Button, Heading} from '@tryghost/admin-x-design-system'; +import {Button, Heading, Select, SelectOption, Tooltip} from '@tryghost/admin-x-design-system'; import {useBrowseInboxForUser} from '../MainContent'; interface InboxProps {} @@ -15,6 +15,7 @@ const Inbox: React.FC = ({}) => { const {data: activities = []} = useBrowseInboxForUser('index'); const [, setArticleContent] = useState(null); const [, setArticleActor] = useState(null); + const [layout, setLayout] = useState('inbox'); const inboxTabActivities = activities.filter((activity: Activity) => { const isCreate = activity.type === 'Create' && ['Article', 'Note'].includes(activity.object.type); @@ -32,13 +33,47 @@ const Inbox: React.FC = ({}) => { }); }; + const selectOptions: SelectOption[] = [ + {value: 'option-1', label: 'Home'}, + {value: 'option-2', label: 'Posts'}, + {value: 'option-3', label: 'Notes'}, + {value: 'option-4', label: 'Media'} + ]; + + const defaultValue: SelectOption = { + value: 'option-1', label: 'Home' + }; + + const controlClasses = { + control: '!bg-transparent !hidden mr-2 !pl-0 text-xl font-bold', + menu: '!min-w-[120px]' + }; + return ( <> +
+
+