fix(ui): restore TopBar search + add notifications bell + theme to sidebar
Follow-up к MR !90 per user feedback iterations: 1) "в поиске по справочникам два крестика" — fixed в SearchInput: `type="search"` (native browser X) → `type="text"`. Custom onClear X остаётся единственным. Catalog input тоже type="text". 2) "блин два крестика было на топбар поиске а тут норм все. верни" — restore TopBar search input. Context-aware behavior сохранён: - На /dictionaries → live filter каталога через URL ?q= - На остальных routes → submit (Enter) → /search records search Single X confirmed by visual test. 3) "свитч темы можно тоже в профиль перенести" — ThemeSwitch переехал в Sidebar footer (рядом с RU/EN button). Right row в footer: lang button слева, theme switch (3 icons sun/moon/monitor) справа через ml-auto. 4) "руководство и версию оставить в топбар чтобы подсвечивать новинки" — Docs + VersionBadge stays in TopBar. Туда же добавлена NotificationsBell (placeholder Bell icon) — broadcast slot для webhook errors / draft reviews / system notices когда backend notifications stream появится.
This commit is contained in:
@@ -16,6 +16,7 @@ import { useAuth } from 'react-oidc-context'
|
||||
import { useCanMutate } from '@/auth/useCanMutate'
|
||||
import { useDictionaries, useMyDrafts } from '@/api/queries'
|
||||
import { Sheet, SheetContent } from '@/ui'
|
||||
import { ThemeSwitch } from '@/components/layout/ThemeSwitch'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
/**
|
||||
@@ -238,20 +239,22 @@ function SidebarFooter({
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Language toggle row (только когда expanded). */}
|
||||
{/* Language toggle + Theme switch row (только когда expanded).
|
||||
* ThemeSwitch и LanguageSwitch переехали из TopBar per user
|
||||
* ("свитч темы можно тоже в профиль перенести"). */}
|
||||
{!collapsed && (
|
||||
<div className="border-t border-line px-3 py-2 flex items-center gap-2 shrink-0">
|
||||
<span className="text-cap text-mute">
|
||||
{t('sidebar.lang', { defaultValue: 'Язык' })}
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => i18n.changeLanguage(next)}
|
||||
className="ml-auto h-7 px-2.5 rounded-md border border-line bg-surface text-cap text-ink-2 hover:bg-surface-2 hover:text-ink transition-colors"
|
||||
className="h-7 px-2.5 rounded-md border border-line bg-surface text-cap text-ink-2 hover:bg-surface-2 hover:text-ink transition-colors"
|
||||
aria-label={`Language: ${cur.toUpperCase()}, click to switch`}
|
||||
>
|
||||
{cur.toUpperCase()}
|
||||
</button>
|
||||
<div className="ml-auto">
|
||||
<ThemeSwitch />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user