From d2779136c5d3f3ad02f7a1e11dfa7f126a703611 Mon Sep 17 00:00:00 2001 From: Yash Kumar Date: Sun, 11 Oct 2026 19:51:21 +0530 Subject: [PATCH] fix(enterprise): address review feedback for dual-mode branding --- .../whitelabeling/whitelabeling-preview.tsx | 12 ++++++++++-- .../whitelabeling/whitelabeling-settings.tsx | 15 ++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/apps/dokploy/components/proprietary/whitelabeling/whitelabeling-preview.tsx b/apps/dokploy/components/proprietary/whitelabeling/whitelabeling-preview.tsx index d53af90a2..5d1beea37 100644 --- a/apps/dokploy/components/proprietary/whitelabeling/whitelabeling-preview.tsx +++ b/apps/dokploy/components/proprietary/whitelabeling/whitelabeling-preview.tsx @@ -1,5 +1,6 @@ "use client"; +import { useTheme } from "next-themes"; import { Card, CardContent, @@ -12,12 +13,19 @@ interface WhitelabelingPreviewProps { config: { appName?: string; logoUrl?: string; + logoLightUrl?: string; + dualModeBranding?: boolean; footerText?: string; }; } export function WhitelabelingPreview({ config }: WhitelabelingPreviewProps) { const appName = config.appName || "Dokploy"; + const { resolvedTheme } = useTheme(); + const effectiveLogoUrl = + config.dualModeBranding && resolvedTheme === "light" && config.logoLightUrl + ? config.logoLightUrl + : config.logoUrl; return ( @@ -31,9 +39,9 @@ export function WhitelabelingPreview({ config }: WhitelabelingPreviewProps) {
{/* Simulated sidebar header */}
- {config.logoUrl ? ( + {effectiveLogoUrl ? ( Preview Logo diff --git a/apps/dokploy/components/proprietary/whitelabeling/whitelabeling-settings.tsx b/apps/dokploy/components/proprietary/whitelabeling/whitelabeling-settings.tsx index c4ce523a7..61c6aba91 100644 --- a/apps/dokploy/components/proprietary/whitelabeling/whitelabeling-settings.tsx +++ b/apps/dokploy/components/proprietary/whitelabeling/whitelabeling-settings.tsx @@ -447,8 +447,21 @@ export function WhitelabelingSettings() { { + field.onChange(checked); + if (!checked) { + form.setValue("logoLightUrl", ""); + form.setValue("loginLogoLightUrl", ""); + form.setValue("faviconLightUrl", ""); + form.clearErrors([ + "logoLightUrl", + "loginLogoLightUrl", + "faviconLightUrl", + ]); + } + }} />