feat(BrandLogo): enhance logo sizing and visibility based on app name visibility
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m57s

This commit is contained in:
2026-03-04 10:23:23 +01:00
parent 8823f8789e
commit 0d84610e3b
2 changed files with 11 additions and 10 deletions

View File

@@ -2,9 +2,9 @@ import { Video } from 'lucide-react';
import { useBranding } from '../contexts/BrandingContext'; import { useBranding } from '../contexts/BrandingContext';
const sizes = { const sizes = {
sm: { box: 'w-8 h-8', rounded: 'rounded-lg', icon: 16, text: 'text-lg' }, sm: { box: 'w-8 h-8', h: 'h-8', maxW: 'max-w-[8rem]', rounded: 'rounded-lg', icon: 16, text: 'text-lg' },
md: { box: 'w-9 h-9', rounded: 'rounded-lg', icon: 20, text: 'text-xl' }, md: { box: 'w-9 h-9', h: 'h-9', maxW: 'max-w-[10rem]', rounded: 'rounded-lg', icon: 20, text: 'text-xl' },
lg: { box: 'w-10 h-10', rounded: 'rounded-xl', icon: 22, text: 'text-2xl' }, lg: { box: 'w-10 h-10', h: 'h-10', maxW: 'max-w-[12rem]', rounded: 'rounded-xl', icon: 22, text: 'text-2xl' },
}; };
export default function BrandLogo({ size = 'md', className = '' }) { export default function BrandLogo({ size = 'md', className = '' }) {
@@ -12,13 +12,14 @@ export default function BrandLogo({ size = 'md', className = '' }) {
const s = sizes[size] || sizes.md; const s = sizes[size] || sizes.md;
if (hasLogo && logoUrl) { if (hasLogo && logoUrl) {
// When the app name is hidden, let the logo expand to its natural aspect
// ratio (w-auto) rather than being clamped into a tiny square.
const imgClass = hideAppName
? `${s.h} w-auto ${s.maxW} ${s.rounded} object-contain`
: `${s.box} ${s.rounded} object-contain`;
return ( return (
<div className={`flex items-center gap-2.5 ${className}`}> <div className={`flex items-center ${hideAppName ? 'justify-center' : 'gap-2.5'} ${className}`}>
<img <img src={logoUrl} alt={appName} className={imgClass} />
src={logoUrl}
alt={appName}
className={`${s.box} ${s.rounded} object-contain`}
/>
{!hideAppName && <span className={`${s.text} font-bold gradient-text`}>{appName}</span>} {!hideAppName && <span className={`${s.text} font-bold gradient-text`}>{appName}</span>}
</div> </div>
); );

View File

@@ -57,7 +57,7 @@ export default function Sidebar({ open, onClose }) {
<div className="flex flex-col h-full"> <div className="flex flex-col h-full">
{/* Logo */} {/* Logo */}
<div className="flex items-center justify-between h-16 px-4 border-b border-th-border"> <div className="flex items-center justify-between h-16 px-4 border-b border-th-border">
<BrandLogo size="sm" /> <BrandLogo size="sm" className="flex-1 min-w-0" />
<button <button
onClick={onClose} onClick={onClose}
className="lg:hidden p-1.5 rounded-lg hover:bg-th-hover text-th-text-s transition-colors" className="lg:hidden p-1.5 rounded-lg hover:bg-th-hover text-th-text-s transition-colors"