From c6e001280c4575513c46474d2f74d523045913ce Mon Sep 17 00:00:00 2001 From: Djordje Vlaisavljevic Date: Tue, 9 Jul 2024 20:42:49 +0100 Subject: [PATCH] Improved alignment and spacing of ViewContainer component ref https://linear.app/tryghost/issue/MOM-261/improve-alignment-and-spacing-of-viewcontainer-component - It now looks a lot better when it's set to be page-level and has tabs and actions --- .../admin-x-activitypub/src/components/ListIndex.tsx | 12 ++++++------ .../src/global/layout/ViewContainer.tsx | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/admin-x-activitypub/src/components/ListIndex.tsx b/apps/admin-x-activitypub/src/components/ListIndex.tsx index a22fd21192..9776a53ab5 100644 --- a/apps/admin-x-activitypub/src/components/ListIndex.tsx +++ b/apps/admin-x-activitypub/src/components/ListIndex.tsx @@ -40,7 +40,7 @@ const ActivityPubComponent: React.FC = () => { { id: 'inbox', title: 'Inbox', - contents:
+ contents:
    {activities && activities.some(activity => activity.type === 'Create' && activity.object.type === 'Article') ? (activities.slice().reverse().map(activity => ( activity.type === 'Create' && activity.object.type === 'Article' && @@ -63,9 +63,9 @@ const ActivityPubComponent: React.FC = () => { { id: 'activity', title: 'Activity', - contents:
    + contents:
    {activities && activities.slice().reverse().map(activity => ( - activity.type === 'Like' && } id='list-item' title={
    {activity.actor.name} liked your post {activity.object.name}
    }>
    + activity.type === 'Like' && } id='list-item' title={
    {activity.actor.name} liked your post {activity.object.name}
    }>
    ))}
    @@ -74,7 +74,7 @@ const ActivityPubComponent: React.FC = () => { { id: 'likes', title: 'Likes', - contents:
    + contents:
      {activities && activities.slice().reverse().map(activity => ( activity.type === 'Create' && activity.object.type === 'Article' && @@ -110,7 +110,7 @@ const ActivityPubComponent: React.FC = () => { setSelectedOption({label: 'Feed', value: 'feed'}); } } - ]} clearBg={false} link outlineOnMobile />]} + ]} clearBg={true} link outlineOnMobile />]} firstOnPage={true} primaryAction={{ title: 'Follow', @@ -242,7 +242,7 @@ const ObjectContentDisplay: React.FC<{actor: ActorProperties, object: ObjectProp
      - +

      {actor.name}

      diff --git a/apps/admin-x-design-system/src/global/layout/ViewContainer.tsx b/apps/admin-x-design-system/src/global/layout/ViewContainer.tsx index 38289b4bad..d7034b6a77 100644 --- a/apps/admin-x-design-system/src/global/layout/ViewContainer.tsx +++ b/apps/admin-x-design-system/src/global/layout/ViewContainer.tsx @@ -179,8 +179,8 @@ const ViewContainer: React.FC = ({ toolbarContainerClassName = clsx( 'flex justify-between gap-5', - (type === 'page' && actions?.length) ? 'flex-col md:flex-row md:items-end' : 'items-end', - (firstOnPage && type === 'page') ? 'pb-3 tablet:pb-8' : (tabs?.length ? '' : 'pb-2'), + (type === 'page' && actions?.length) ? (tabs?.length ? 'flex-col md:flex-row md:items-start' : 'flex-col md:flex-row md:items-end') : 'items-end', + (firstOnPage && type === 'page' && !tabs?.length) ? 'pb-3 tablet:pb-8' : (tabs?.length ? '' : 'pb-2'), toolbarBorder && 'border-b border-grey-200 dark:border-grey-900', toolbarContainerClassName );