fix: prevent header nav shift with invisible theme button placeholder

This commit is contained in:
c0mrade
2026-02-06 03:11:35 +03:00
parent 48eee9fac4
commit 50e675b6e9

View File

@@ -350,18 +350,19 @@ export function AppShell({ children }: AppShellProps) {
{/* Right side actions */} {/* Right side actions */}
<div className="flex items-center justify-end gap-2"> <div className="flex items-center justify-end gap-2">
{canToggleTheme && ( <button
<button onClick={() => {
onClick={() => { haptic.impact('light');
haptic.impact('light'); toggleTheme();
toggleTheme(); }}
}} className={cn(
className="rounded-xl border border-dark-700/50 bg-dark-800/50 p-2 text-dark-400 transition-all duration-200 hover:bg-dark-700 hover:text-accent-400" 'rounded-xl border border-dark-700/50 bg-dark-800/50 p-2 text-dark-400 transition-all duration-200 hover:bg-dark-700 hover:text-accent-400',
title={isDark ? t('theme.light') || 'Light mode' : t('theme.dark') || 'Dark mode'} !canToggleTheme && 'pointer-events-none invisible',
> )}
{isDark ? <MoonIcon className="h-5 w-5" /> : <SunIcon className="h-5 w-5" />} title={isDark ? t('theme.light') || 'Light mode' : t('theme.dark') || 'Dark mode'}
</button> >
)} {isDark ? <MoonIcon className="h-5 w-5" /> : <SunIcon className="h-5 w-5" />}
</button>
<TicketNotificationBell isAdmin={location.pathname.startsWith('/admin')} /> <TicketNotificationBell isAdmin={location.pathname.startsWith('/admin')} />
<LanguageSwitcher /> <LanguageSwitcher />
<button <button