sdlc-hub/web/src/shell/AppBar.tsx
Andrey Epifancev 2a472cacbf style(web): вход, новый проект, служебные экраны; старые стили убраны (#65)
Экраны входа, «Новый проект», ProjectGate, «не найдено» и ошибка отрисовки
переведены на компоненты системы. controls.css удалён, псевдонимы токенов
убраны, глобальные .row/.spacer/.hint/.warn/.login разобраны. Разделы в
верхней панели не активны вне доски и задач. Тонкая настройка дорожек доски,
тест на ошибку списка, стабилизирован тест проектов.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 01:19:09 +04:00

29 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { useQueryClient } from "@tanstack/react-query";
import { clearToken } from "../auth/token.ts";
import { withProject } from "../projects/current.ts";
import { ProjectPicker } from "../projects/ProjectPicker.tsx";
import { Menu, MenuItem, Segmented, ThemeSwitch } from "../ui/index.ts";
import { DataStatus } from "./DataStatus.tsx";
export type Section = "/board" | "/issues";
// верхняя панель (design.md, решение 9); section = null на путях вне разделов — активной ссылки нет (T5.1): название, проект, разделы, состояние данных, тема, меню «Ещё»
export function AppBar({ section, project }: { section: Section | null; project: string | null }) {
const qc = useQueryClient();
const href = (to: Section) => (project ? to + withProject("", project) : to);
return (
<header className="appbar">
<span className="appbar__brand">Хаб Jira</span>
<ProjectPicker />
<Segmented label="Раздел" value={section}
options={[{ value: "/board", label: "Доска связей", href: href("/board") }, { value: "/issues", label: "Задачи", href: href("/issues") }]} />
<span className="appbar__spacer" />
<DataStatus project={project} />
<ThemeSwitch />
<Menu label="Ещё">
{(close) => <MenuItem onSelect={() => { close(); clearToken(); qc.clear(); }}>Сменить токен</MenuItem>}
</Menu>
</header>
);
}