From fe74f8a33e6806aa3299f009c3820cf2bef3027b Mon Sep 17 00:00:00 2001 From: Delowar Hossain Date: Tue, 7 Apr 2026 02:07:50 +0600 Subject: [PATCH] Hide preview button unless collection supports preview and content is published (#70) * Hide preview button unless collection supports preview and content is published * Remove isPublished check --------- Co-authored-by: Matt Kane --- packages/admin/src/components/ContentEditor.tsx | 5 ++++- packages/admin/src/router.tsx | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/admin/src/components/ContentEditor.tsx b/packages/admin/src/components/ContentEditor.tsx index d55d82e..42e5ab7 100644 --- a/packages/admin/src/components/ContentEditor.tsx +++ b/packages/admin/src/components/ContentEditor.tsx @@ -122,6 +122,8 @@ export interface ContentEditorProps { supportsDrafts?: boolean; /** Whether this collection supports revisions */ supportsRevisions?: boolean; + /** Whether this collection supports preview */ + supportsPreview?: boolean; /** Current user (for permission checks) */ currentUser?: CurrentUserInfo; /** Available users for author selection (only shown to editors+) */ @@ -190,6 +192,7 @@ export function ContentEditor({ isScheduling, supportsDrafts = false, supportsRevisions = false, + supportsPreview = false, currentUser, users, onAuthorChange, @@ -523,7 +526,7 @@ export function ContentEditor({