feat: adjust branding logo styling

This commit is contained in:
nite-knite 2025-05-21 12:16:57 +08:00
parent db632e363e
commit cb69b926d5
2 changed files with 5 additions and 4 deletions

View File

@ -33,16 +33,17 @@ const DifyLogo: FC<DifyLogoProps> = ({
const { theme } = useTheme() const { theme } = useTheme()
const themedStyle = (theme === 'dark' && style === 'default') ? 'monochromeWhite' : style const themedStyle = (theme === 'dark' && style === 'default') ? 'monochromeWhite' : style
const { systemFeatures } = useGlobalPublicStore() const { systemFeatures } = useGlobalPublicStore()
const hasBrandingLogo = Boolean(systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo)
let src = `${basePath}${logoPathMap[themedStyle]}` let src = `${basePath}${logoPathMap[themedStyle]}`
if (systemFeatures.branding.enabled) if (hasBrandingLogo)
src = systemFeatures.branding.workspace_logo src = systemFeatures.branding.workspace_logo
return ( return (
<img <img
src={src} src={src}
className={classNames('block object-contain', logoSizeMap[size], className)} className={classNames('block object-contain', logoSizeMap[size], hasBrandingLogo && 'w-auto', className)}
alt='Dify logo' alt={hasBrandingLogo ? 'Logo' : 'Dify logo'}
/> />
) )
} }

View File

@ -60,7 +60,7 @@ const Header = () => {
{ {
!isMobile !isMobile
&& <div className='flex shrink-0 items-center gap-1.5 self-stretch pl-3'> && <div className='flex shrink-0 items-center gap-1.5 self-stretch pl-3'>
<Link href="/apps" className='flex h-8 w-[52px] shrink-0 items-center justify-center gap-2'> <Link href="/apps" className='flex h-8 shrink-0 items-center justify-center gap-2 px-0.5'>
<DifyLogo /> <DifyLogo />
</Link> </Link>
<div className='font-light text-divider-deep'>/</div> <div className='font-light text-divider-deep'>/</div>