diff --git a/apps/admin-x-activitypub/package.json b/apps/admin-x-activitypub/package.json index 2e432a0c3a5..c3ec1ed59bb 100644 --- a/apps/admin-x-activitypub/package.json +++ b/apps/admin-x-activitypub/package.json @@ -1,6 +1,6 @@ { "name": "@tryghost/admin-x-activitypub", - "version": "0.3.0", + "version": "0.3.1", "license": "MIT", "repository": { "type": "git", diff --git a/apps/admin-x-activitypub/src/components/Inbox.tsx b/apps/admin-x-activitypub/src/components/Inbox.tsx index 3a359e6075e..c47027d1e51 100644 --- a/apps/admin-x-activitypub/src/components/Inbox.tsx +++ b/apps/admin-x-activitypub/src/components/Inbox.tsx @@ -19,7 +19,7 @@ interface InboxProps {} const Inbox: React.FC = ({}) => { const [, setArticleContent] = useState(null); const [, setArticleActor] = useState(null); - const {layout} = useLayout(); + const {layout, setFeed, setInbox} = useLayout(); const { data, @@ -104,7 +104,7 @@ const Inbox: React.FC = ({}) => { return ( <> - +
{isLoading ? ( diff --git a/apps/admin-x-activitypub/src/components/navigation/MainNavigation.tsx b/apps/admin-x-activitypub/src/components/navigation/MainNavigation.tsx index 8828ae10457..76a1c186281 100644 --- a/apps/admin-x-activitypub/src/components/navigation/MainNavigation.tsx +++ b/apps/admin-x-activitypub/src/components/navigation/MainNavigation.tsx @@ -1,19 +1,23 @@ import MainHeader from './MainHeader'; import React from 'react'; import {Button, Tooltip} from '@tryghost/admin-x-design-system'; -import {useLayout} from '../../hooks/layout'; import {useRouting} from '@tryghost/admin-x-framework/routing'; interface MainNavigationProps { page: string; + layout?: 'feed' | 'inbox'; + setFeed?: () => void; + setInbox?: () => void; } const MainNavigation: React.FC = ({ - page = '' + page = '', + layout, + setFeed, + setInbox }) => { const {route, updateRoute} = useRouting(); const mainRoute = route.split('/')[0]; - const {layout, setFeed, setInbox} = useLayout(); return ( diff --git a/apps/admin-x-activitypub/src/hooks/layout.ts b/apps/admin-x-activitypub/src/hooks/layout.ts index b65b44327c1..62205878b8c 100644 --- a/apps/admin-x-activitypub/src/hooks/layout.ts +++ b/apps/admin-x-activitypub/src/hooks/layout.ts @@ -14,5 +14,5 @@ export function useLayout() { const setFeed = () => setLayout('feed'); const setInbox = () => setLayout('inbox'); - return {layout, setInbox, setFeed}; + return {layout, setInbox, setFeed} as {layout: Layout, setInbox: () => void, setFeed: () => void}; }