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,24 +151,35 @@ export function DocumentsHub({ portSlug }: DocumentsHubProps) {
|
||||
}
|
||||
/>
|
||||
<div className="flex-1 min-w-0 p-4 space-y-4">
|
||||
<FolderBreadcrumb selectedFolderId={selectedFolderId} onSelect={handleFolderSelect} />
|
||||
|
||||
<PageHeader
|
||||
title="Documents"
|
||||
description="Track signing status, chase pending signers, and audit completion."
|
||||
actions={
|
||||
<Button asChild>
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<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>
|
||||
}
|
||||
variant="gradient"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{selectedFolderId === undefined ? (
|
||||
<HubRootView portSlug={portSlug} />
|
||||
<>
|
||||
<PageHeader
|
||||
title="Documents"
|
||||
description="Track signing status, chase pending signers, and audit completion."
|
||||
actions={
|
||||
<Button asChild>
|
||||
<Link href={`/${portSlug}/documents/new`}>
|
||||
<Plus className="mr-1.5 h-4 w-4" />
|
||||
New document
|
||||
</Link>
|
||||
</Button>
|
||||
}
|
||||
variant="gradient"
|
||||
/>
|
||||
<HubRootView portSlug={portSlug} />
|
||||
</>
|
||||
) : isEntityFolder && isEntityType(folderEntityType) ? (
|
||||
<EntityFolderView
|
||||
portSlug={portSlug}
|
||||
|
||||
Reference in New Issue
Block a user