From f34850e1578caf00db5900f4a31868ade8e68445 Mon Sep 17 00:00:00 2001 From: host Date: Sat, 25 Jul 2026 04:27:55 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.jsx | 171 ++++++++++++++++++++++++++++--------------- 1 file changed, 111 insertions(+), 60 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 7945aaa..36215e8 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1,5 +1,5 @@ import React, { useEffect, useState, createContext, useContext } from "react"; -import { Routes, Route, Navigate, Link, useNavigate } from "react-router-dom"; +import { Routes, Route, Navigate, NavLink, useNavigate, Link } from "react-router-dom"; import { api } from "./api.js"; import Login from "./pages/Login.jsx"; import Register from "./pages/Register.jsx"; @@ -38,34 +38,83 @@ function Protected({ user, loading, children }) { return children; } -function Topbar() { +// Иконки (inline SVG — без зависимостей). +const Icon = ({ d, size = 18 }) => ( + + + +); + +const Icons = { + server: "M5 4h14a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM5 14h14a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1zM7 6h.01M7 16h.01", + grid: "M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z", + users: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75", + logout: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9", + layers: "M12 2 2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5", +}; + +function Sidebar() { const { user, setUser } = useAuth(); const navigate = useNavigate(); + if (!user) return null; + + const navLinkClass = ({ isActive }) => + "nav-link" + (isActive ? " active" : ""); + return ( -
-
- $ vps-panel + ); } @@ -75,44 +124,46 @@ export default function App() { return (
- - - } /> - } /> - - + {user && } +
+ + } /> + } /> + + - } - /> - - - - } - /> - - - - } - /> - - - - } - /> - + } + /> + + + + } + /> + + + + } + /> + + + + } + /> + +
); -} +} \ No newline at end of file