1- import { type PropsWithChildren , type ReactNode , useEffect , useRef , useState } from 'react'
1+ import { type CSSProperties , type PropsWithChildren , type ReactNode , useEffect , useRef , useState } from 'react'
22import { NavLink , useLocation } from 'react-router-dom'
33import { LayoutDashboard , Users , Activity , Settings , Server , Sun , Moon , Languages , Globe , BookOpen , KeyRound , Image as ImageIcon , ShieldAlert , ExternalLink , ChevronLeft , ChevronRight } from 'lucide-react'
44import { useTranslation } from 'react-i18next'
@@ -108,10 +108,10 @@ export default function Layout({ children }: PropsWithChildren) {
108108 return (
109109 < div className = "min-h-dvh" >
110110 < div
111- className = "grid max-w-full max-lg: grid-cols-1 max-lg:px-3 transition-[grid-template-columns] duration-200"
111+ className = "grid max-w-full grid-cols-1 max-lg:px-3 lg:grid-cols-[var(--admin-layout-columns)] transition-[grid-template-columns] duration-200"
112112 style = { {
113- gridTemplateColumns : sidebarCollapsed ? '64px minmax(0,1fr)' : '264px minmax(0,1fr)' ,
114- } }
113+ '--admin-layout-columns' : sidebarCollapsed ? '64px minmax(0,1fr)' : '264px minmax(0,1fr)' ,
114+ } as CSSProperties }
115115 >
116116 { /* Sidebar - desktop */ }
117117 < aside className = "sticky top-0 self-start h-dvh border-r border-border bg-[hsl(var(--sidebar-background))] max-lg:hidden" >
@@ -268,12 +268,12 @@ export default function Layout({ children }: PropsWithChildren) {
268268 { /* Main content */ }
269269 < main className = "min-w-0 p-5 max-lg:p-3 max-lg:pb-[92px]" >
270270 { /* Mobile topbar */ }
271- < header className = "hidden max-lg:flex items-center justify-between gap-4 mb-4 p-3 border border-border rounded-lg bg-card/95 shadow-sm" >
272- < div className = "flex items-center gap-3" >
271+ < header className = "hidden max-lg:flex min-w-0 w-full max-w-full items-center justify-between gap-2 overflow-hidden mb-4 p-3 border border-border rounded-lg bg-card/95 shadow-sm" >
272+ < div className = "flex min-w-0 flex-1 items-center gap-3" >
273273 < img src = { logoSrc } alt = { siteName } className = "w-8 h-8 rounded-[10px] object-cover" />
274- < strong className = "max -w-[150px] truncate text-lg" title = { siteName } > { siteName } </ strong >
274+ < strong className = "min -w-0 flex-1 truncate text-lg" title = { siteName } > { siteName } </ strong >
275275 </ div >
276- < div className = "flex items-center gap-2 " >
276+ < div className = "flex shrink-0 items-center gap-1.5 " >
277277 < button
278278 onClick = { toggleLang }
279279 className = "flex items-center justify-center size-8 rounded-lg text-muted-foreground hover:text-foreground transition-colors text-[11px] font-bold"
@@ -290,7 +290,7 @@ export default function Layout({ children }: PropsWithChildren) {
290290 { theme === 'dark' ? < Sun className = "size-4" /> : < Moon className = "size-4" /> }
291291 </ span >
292292 </ button >
293- < span className = "inline-flex items-center justify-center min-h-[28px] px-2.5 rounded-full text-[12px] font-bold bg-[hsl(var(--success-bg))] text-[hsl(var(--success))] shrink-0 whitespace-nowrap" >
293+ < span className = "inline-flex items-center justify-center min-h-[28px] px-2.5 rounded-full text-[12px] font-bold bg-[hsl(var(--success-bg))] text-[hsl(var(--success))] shrink-0 whitespace-nowrap max-[420px]:hidden " >
294294 { t ( 'common.online' ) }
295295 </ span >
296296 </ div >
@@ -316,7 +316,7 @@ export default function Layout({ children }: PropsWithChildren) {
316316 } `}
317317 >
318318 { item . icon }
319- < span > { t ( item . labelKey ) } </ span >
319+ < span className = "w-full truncate leading-tight" > { t ( item . labelKey ) } </ span >
320320 </ NavLink >
321321 )
322322 } ) }
0 commit comments