fix(documents-hub): scope gradient PageHeader to root view; add inline New-document button on folder views
The gradient "Documents — Track signing status..." banner was rendering on all three render modes (HubRootView / EntityFolderView / FlatFolderListing), duplicating the in-empty-state CTA on folder views. Keep it only on the root landing page; for folder views, surface a compact "+ New document" button in the upper-right aligned with the FolderBreadcrumb row. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -151,8 +151,20 @@ export function DocumentsHub({ portSlug }: DocumentsHubProps) {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<div className="flex-1 min-w-0 p-4 space-y-4">
|
<div className="flex-1 min-w-0 p-4 space-y-4">
|
||||||
|
<div className="flex items-center justify-between gap-3">
|
||||||
<FolderBreadcrumb selectedFolderId={selectedFolderId} onSelect={handleFolderSelect} />
|
<FolderBreadcrumb selectedFolderId={selectedFolderId} onSelect={handleFolderSelect} />
|
||||||
|
{selectedFolderId !== undefined && (
|
||||||
|
<Button asChild size="sm">
|
||||||
|
<Link href={`/${portSlug}/documents/new`}>
|
||||||
|
<Plus className="mr-1.5 h-4 w-4" />
|
||||||
|
New document
|
||||||
|
</Link>
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{selectedFolderId === undefined ? (
|
||||||
|
<>
|
||||||
<PageHeader
|
<PageHeader
|
||||||
title="Documents"
|
title="Documents"
|
||||||
description="Track signing status, chase pending signers, and audit completion."
|
description="Track signing status, chase pending signers, and audit completion."
|
||||||
@@ -166,9 +178,8 @@ export function DocumentsHub({ portSlug }: DocumentsHubProps) {
|
|||||||
}
|
}
|
||||||
variant="gradient"
|
variant="gradient"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{selectedFolderId === undefined ? (
|
|
||||||
<HubRootView portSlug={portSlug} />
|
<HubRootView portSlug={portSlug} />
|
||||||
|
</>
|
||||||
) : isEntityFolder && isEntityType(folderEntityType) ? (
|
) : isEntityFolder && isEntityType(folderEntityType) ? (
|
||||||
<EntityFolderView
|
<EntityFolderView
|
||||||
portSlug={portSlug}
|
portSlug={portSlug}
|
||||||
|
|||||||
Reference in New Issue
Block a user