fix(enterprise): address review feedback for dual-mode branding

This commit is contained in:
Yash Kumar
2026-10-11 19:51:21 +05:30
parent 0b537a815d
commit d2779136c5
2 changed files with 24 additions and 3 deletions
@@ -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 (
<Card className="bg-transparent">
@@ -31,9 +39,9 @@ export function WhitelabelingPreview({ config }: WhitelabelingPreviewProps) {
<div className="rounded-lg border overflow-hidden">
{/* Simulated sidebar header */}
<div className="flex items-center gap-3 p-4 border-b bg-sidebar">
{config.logoUrl ? (
{effectiveLogoUrl ? (
<img
src={config.logoUrl}
src={effectiveLogoUrl}
alt="Preview Logo"
className="size-8 rounded-sm object-contain"
/>
@@ -447,8 +447,21 @@ export function WhitelabelingSettings() {
<FormItem>
<FormControl>
<Switch
aria-label="Enable light mode logos"
checked={field.value}
onCheckedChange={field.onChange}
onCheckedChange={(checked) => {
field.onChange(checked);
if (!checked) {
form.setValue("logoLightUrl", "");
form.setValue("loginLogoLightUrl", "");
form.setValue("faviconLightUrl", "");
form.clearErrors([
"logoLightUrl",
"loginLogoLightUrl",
"faviconLightUrl",
]);
}
}}
/>
</FormControl>
</FormItem>