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="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" className={cn(
'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',
!canToggleTheme && 'pointer-events-none invisible',
)}
title={isDark ? t('theme.light') || 'Light mode' : t('theme.dark') || 'Dark mode'} title={isDark ? t('theme.light') || 'Light mode' : t('theme.dark') || 'Dark mode'}
> >
{isDark ? <MoonIcon className="h-5 w-5" /> : <SunIcon className="h-5 w-5" />} {isDark ? <MoonIcon className="h-5 w-5" /> : <SunIcon className="h-5 w-5" />}
</button> </button>
)}
<TicketNotificationBell isAdmin={location.pathname.startsWith('/admin')} /> <TicketNotificationBell isAdmin={location.pathname.startsWith('/admin')} />
<LanguageSwitcher /> <LanguageSwitcher />
<button <button