From e7cd3702997144725ac90289e5aecd101856bc92 Mon Sep 17 00:00:00 2001 From: Fringg Date: Wed, 11 Mar 2026 01:34:44 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20responsive=20desktop=20nav=20=E2=80=94?= =?UTF-8?q?=20icon-only=20on=20lg,=20icon+text=20on=20xl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove horizontal scroll from desktop top nav bar. Items now show icons only at 1024-1279px with native tooltips, and icons+labels at 1280px+. All 9 items fit on screen in any language without scrolling. --- src/components/layout/AppShell/AppShell.tsx | 168 ++++++++------------ 1 file changed, 65 insertions(+), 103 deletions(-) diff --git a/src/components/layout/AppShell/AppShell.tsx b/src/components/layout/AppShell/AppShell.tsx index fbc10f8..4b168df 100644 --- a/src/components/layout/AppShell/AppShell.tsx +++ b/src/components/layout/AppShell/AppShell.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useRef, useState } from 'react'; +import { useEffect, useState } from 'react'; import { useLocation, Link } from 'react-router'; import { useQuery } from '@tanstack/react-query'; import { useTranslation } from 'react-i18next'; @@ -269,31 +269,6 @@ export function AppShell({ children }: AppShellProps) { haptic.impact('light'); }; - // Desktop nav scroll fade indicators - const navRef = useRef(null); - const [navCanScrollLeft, setNavCanScrollLeft] = useState(false); - const [navCanScrollRight, setNavCanScrollRight] = useState(false); - - const updateNavScroll = useCallback(() => { - const el = navRef.current; - if (!el) return; - setNavCanScrollLeft(el.scrollLeft > 2); - setNavCanScrollRight(el.scrollLeft + el.clientWidth < el.scrollWidth - 2); - }, []); - - useEffect(() => { - const el = navRef.current; - if (!el) return; - updateNavScroll(); - el.addEventListener('scroll', updateNavScroll, { passive: true }); - const ro = new ResizeObserver(updateNavScroll); - ro.observe(el); - return () => { - el.removeEventListener('scroll', updateNavScroll); - ro.disconnect(); - }; - }, [updateNavScroll]); - // Calculate header height based on fullscreen mode (only on mobile Telegram) // On iOS: contentSafeAreaInset.top includes status bar + dynamic island + Telegram header // On Android: safeAreaInset.top only includes status bar, need to add Telegram header height (~48px) @@ -342,89 +317,76 @@ export function AppShell({ children }: AppShellProps) { {/* Center Navigation */} -
- {/* Left fade */} -
- {/* Right fade */} -
-
+ + )} + {/* Right side actions */}