From ae01ebdeeac7c314c59a71f75ec1d33086bb3bbf Mon Sep 17 00:00:00 2001 From: heagbokat Date: Fri, 26 Jun 2026 00:51:42 +0300 Subject: [PATCH] feat: clean navbar icons, floating theme bubble, auto theme on first visit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Navbar: remove theme switcher, clean nav icons (no text labels), active state is accent dot underline + icon color — no pill bg - useTheme: drop 'system' from stored type; first visit = auto by system preference, stays unset until user explicitly clicks - ThemeBubble: fixed bottom-right pill with Sun/Moon icon + label, hover lift, click toggles light ↔ dark and persists to localStorage - App.tsx: render ThemeBubble inside ThemeProvider Co-Authored-By: Claude Sonnet 4.6 --- client/src/App.tsx | 2 + client/src/components/Navbar.tsx | 77 ++++++++++++--------------- client/src/components/ThemeBubble.tsx | 31 +++++++++++ client/src/hooks/useTheme.tsx | 30 +++++------ 4 files changed, 80 insertions(+), 60 deletions(-) create mode 100644 client/src/components/ThemeBubble.tsx diff --git a/client/src/App.tsx b/client/src/App.tsx index 0be805b..5639ec3 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -5,6 +5,7 @@ import { ThemeProvider } from '@/hooks/useTheme'; import { ToastProvider } from '@/components/Toast'; import ProtectedRoute from '@/components/ProtectedRoute'; import Navbar from '@/components/Navbar'; +import ThemeBubble from '@/components/ThemeBubble'; import LoginPage from '@/pages/LoginPage'; import RegisterPage from '@/pages/RegisterPage'; import FeedPage from '@/pages/FeedPage'; @@ -107,6 +108,7 @@ export default function App() { +
diff --git a/client/src/components/Navbar.tsx b/client/src/components/Navbar.tsx index df070dc..b0ebf15 100644 --- a/client/src/components/Navbar.tsx +++ b/client/src/components/Navbar.tsx @@ -1,26 +1,17 @@ import { Link, useLocation } from 'react-router-dom'; import { useAuth } from '@/hooks/useAuth'; -import { useTheme } from '@/hooks/useTheme'; import UserAvatar from '@/components/UserAvatar'; -import { Home, PlusSquare, Shield, Sun, Moon, Monitor } from 'lucide-react'; +import { Home, PlusSquare, Shield } from 'lucide-react'; export default function Navbar() { const { user } = useAuth(); - const { theme, setTheme } = useTheme(); const location = useLocation(); - const cycleTheme = () => { - const next: Record = { light: 'dark', dark: 'system', system: 'light' }; - setTheme(next[theme]); - }; - const ThemeIcon = theme === 'dark' ? Moon : theme === 'light' ? Sun : Monitor; - const themeLabel = theme === 'dark' ? 'Тёмная' : theme === 'light' ? 'Светлая' : 'Авто'; - if (!user) return null; - const isProfile = location.pathname.startsWith('/profile'); - const isFeed = location.pathname === '/feed' || location.pathname === '/'; + const isFeed = location.pathname === '/feed' || location.pathname === '/'; const isUpload = location.pathname === '/upload'; + const isProfile = location.pathname.startsWith('/profile'); return (