@@ -3,19 +3,24 @@ import { FaCode } from "react-icons/fa";
|
||||
import {
|
||||
FaHome,
|
||||
FaServer,
|
||||
FaPalette,
|
||||
FaUser,
|
||||
FaUsers,
|
||||
FaRocket,
|
||||
FaKey,
|
||||
FaFileAlt,
|
||||
FaSun,
|
||||
FaMoon,
|
||||
} from "react-icons/fa";
|
||||
import { useAuthStore } from "@/modules/auth/store/useAuthStore";
|
||||
import { useThemeStore } from "@/modules/theme-bw/stores/theme.store";
|
||||
|
||||
export const Navigation = () => {
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
const { user, logout } = useAuthStore();
|
||||
const { toggleTheme, theme } = useThemeStore();
|
||||
|
||||
const isDark = theme === "dark";
|
||||
|
||||
const navItems = [
|
||||
{ path: "/", label: "Главная", icon: FaHome },
|
||||
@@ -25,7 +30,6 @@ export const Navigation = () => {
|
||||
{ path: "/registration", label: "Регистрация", icon: FaKey },
|
||||
{ path: "/logs", label: "Логи", icon: FaFileAlt },
|
||||
{ path: "/admin", label: "Админка", icon: FaUsers, adminOnly: true },
|
||||
{ path: "/themes", label: "Темы", icon: FaPalette },
|
||||
];
|
||||
|
||||
const isActive = (path: string) => location.pathname === path;
|
||||
@@ -101,6 +105,21 @@ export const Navigation = () => {
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Переключатель темы */}
|
||||
<button
|
||||
onClick={toggleTheme}
|
||||
className="p-1.5 rounded-lg transition-colors"
|
||||
style={{
|
||||
backgroundColor: "var(--bg-secondary)",
|
||||
color: isDark ? "#fbbf24" : "#3b82f6",
|
||||
border: "1px solid var(--border)",
|
||||
}}
|
||||
title={isDark ? "Светлая тема" : "Тёмная тема"}
|
||||
>
|
||||
{isDark ? <FaSun size={12} /> : <FaMoon size={12} />}
|
||||
</button>
|
||||
|
||||
<button
|
||||
onClick={() => {
|
||||
logout();
|
||||
|
||||
Reference in New Issue
Block a user