mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-10-15 05:11:26 +00:00
fix(enterprise): address review feedback for dual-mode branding
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user