From 3265b1a16a84150cb7166126d7bbcecec5ed6b41 Mon Sep 17 00:00:00 2001 From: Tracewebstudio Dev Date: Wed, 15 Apr 2026 00:15:22 +0200 Subject: [PATCH] Align external preview UX and unlock leads preview flow --- .../admin/DashboardDesignPreview.tsx | 50 +++++++++++++------ 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/src/components/admin/DashboardDesignPreview.tsx b/src/components/admin/DashboardDesignPreview.tsx index 5c9f8de..7404b3c 100644 --- a/src/components/admin/DashboardDesignPreview.tsx +++ b/src/components/admin/DashboardDesignPreview.tsx @@ -560,8 +560,6 @@ function portfolioMediaConfig(roleKey: string): { || normalized === 'GRAPHIC_DESIGNER' || normalized === 'SOCIAL_MEDIA_MANAGER' || normalized === 'CATERING_SERVICES' - || normalized === 'DEVELOPER' - || normalized === 'FITNESS_TRAINER' ) { return { mode: 'visual', @@ -1622,6 +1620,7 @@ export default function DashboardDesignPreview(props: { const serviceTabKey = normalizeTabKey(spec.serviceTabLabel); const galleryTabKey = normalizeTabKey(spec.galleryTabLabel); const experienceTabKey = normalizeTabKey(spec.experienceTabLabel); + const requiresVisualAssets = mediaConfig.mode === 'visual'; const testimonialsTabKey = normalizeTabKey('testimonials'); const faqsTabKey = normalizeTabKey('faqs'); const portfolioJobsCompleted = portfolioJobsCompletedPreview; @@ -1708,7 +1707,7 @@ export default function DashboardDesignPreview(props: { }); if (stepKey === serviceTabKey && portfolioServices().length < 1) { setPortfolioValidationNotice('Add at least one service with pricing.'); - } else if (stepKey === galleryTabKey && (portfolioPhotos().length < 1 || portfolioPhotos().length > 6)) { + } else if (stepKey === galleryTabKey && requiresVisualAssets && (portfolioPhotos().length < 1 || portfolioPhotos().length > 6)) { setPortfolioValidationNotice('Add 1 to 6 portfolio photos.'); } else if (stepKey === experienceTabKey && portfolioExperiences().length < 1) { setPortfolioValidationNotice('Add at least one experience entry.'); @@ -1720,7 +1719,7 @@ export default function DashboardDesignPreview(props: { setPortfolioFormErrors((prev) => ({ ...prev, ...nextErrors })); return Object.keys(nextErrors).length === 0 && !(stepKey === serviceTabKey && portfolioServices().length < 1) - && !(stepKey === galleryTabKey && (portfolioPhotos().length < 1 || portfolioPhotos().length > 6)) + && !(stepKey === galleryTabKey && requiresVisualAssets && (portfolioPhotos().length < 1 || portfolioPhotos().length > 6)) && !(stepKey === experienceTabKey && portfolioExperiences().length < 1); }; const addServiceDraft = () => { @@ -1901,18 +1900,36 @@ export default function DashboardDesignPreview(props: {
-
-

Portfolio photos ({portfolioPhotos().length}/6)

- -
-
- {(photo, idx) => ( -
- {photo} - + +

Structured work proof (photos optional)

+ {(item, idx) => ( +
+ +
+

{item}

+

Entry #{idx() + 1} for outcome-focused portfolio evidence.

+
+
+ )}
- )}
-
+ } + > +
+

Portfolio photos ({portfolioPhotos().length}/6)

+ +
+
+ {(photo, idx) => ( +
+ {photo} + +
+ )}
+
+
@@ -2853,7 +2870,8 @@ export default function DashboardDesignPreview(props: { } if (customerKey() === 'leads') { - if (!bothApprovalsApproved()) { + const lockLeadsPreview = false; + if (lockLeadsPreview && !bothApprovalsApproved()) { return (