From d32237975d880007ba91f2d05d93082fe5ee44c2 Mon Sep 17 00:00:00 2001 From: NotBigGhost Date: Fri, 26 Jun 2026 16:40:49 +0300 Subject: [PATCH] =?UTF-8?q?UI:=20=D1=81=D0=B5=D0=BA=D1=80=D0=B5=D1=82?= =?UTF-8?q?=D0=BD=D1=8B=D0=B9=20=D0=B2=D1=85=D0=BE=D0=B4=20=D0=B2=20=D0=B0?= =?UTF-8?q?=D0=B4=D0=BC=D0=B8=D0=BD=D0=BA=D1=83=20=E2=80=94=20=D1=83=D0=B4?= =?UTF-8?q?=D0=B5=D1=80=D0=B6=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BD=D0=BE?= =?UTF-8?q?=D0=BF=D0=BA=D0=B8=20=D0=BC=D0=B5=D0=BD=D1=8E=2010=D1=81;=20?= =?UTF-8?q?=D1=83=D0=B1=D1=80=D0=B0=D0=BD=D1=8B=20=D0=B2=D0=B8=D0=B4=D0=B8?= =?UTF-8?q?=D0=BC=D1=8B=D0=B5=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B2=D1=85=D0=BE=D0=B4=D0=B0=20=D0=B0=D0=B4=D0=BC=D0=B8=D0=BD?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 --- frontend/src/components/BottomBar.tsx | 34 ++++++++++++++++++++++++++- frontend/src/pages/AccountPage.tsx | 6 ----- frontend/src/pages/LoginPage.tsx | 10 -------- 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/BottomBar.tsx b/frontend/src/components/BottomBar.tsx index f656d54..f917ac6 100644 --- a/frontend/src/components/BottomBar.tsx +++ b/frontend/src/components/BottomBar.tsx @@ -1,9 +1,12 @@ import { Menu, Plus, Users } from "lucide-react"; +import { useRef } from "react"; import { useNavigate } from "react-router-dom"; import { useToast } from "../context/ToastContext"; import { useMe } from "../hooks/auth"; +const ADMIN_HOLD_MS = 10000; // секретный вход в админку — удержание кнопки меню 10с + export function BottomBar({ onMenu }: { onMenu: () => void }) { const { data: me } = useMe(); const navigate = useNavigate(); @@ -11,6 +14,28 @@ export function BottomBar({ onMenu }: { onMenu: () => void }) { const hasGroup = me?.active_group_id != null; const activeGroup = me?.groups.find((g) => g.id === me?.active_group_id); + // Долгое удержание кнопки меню → /admin/login; короткий тап → открыть боковое меню. + const holdTimer = useRef | null>(null); + const holdFired = useRef(false); + + const startHold = () => { + holdFired.current = false; + holdTimer.current = setTimeout(() => { + holdFired.current = true; + navigate("/admin/login"); + }, ADMIN_HOLD_MS); + }; + const clearHold = () => { + if (holdTimer.current) { + clearTimeout(holdTimer.current); + holdTimer.current = null; + } + }; + const endHold = () => { + clearHold(); + if (!holdFired.current) onMenu(); // обычный тап + }; + const onCreate = () => { if (!hasGroup) { toast.show("Вы не состоите в группе. Создайте или вступите в группу."); @@ -29,7 +54,14 @@ export function BottomBar({ onMenu }: { onMenu: () => void }) {
- diff --git a/frontend/src/pages/AccountPage.tsx b/frontend/src/pages/AccountPage.tsx index bae0b26..bf14762 100644 --- a/frontend/src/pages/AccountPage.tsx +++ b/frontend/src/pages/AccountPage.tsx @@ -158,12 +158,6 @@ export function AccountPage() { - -

- -

); } diff --git a/frontend/src/pages/LoginPage.tsx b/frontend/src/pages/LoginPage.tsx index 2d94dfa..cb82bc0 100644 --- a/frontend/src/pages/LoginPage.tsx +++ b/frontend/src/pages/LoginPage.tsx @@ -93,16 +93,6 @@ export function LoginPage() { {showStub && !pendingTg && } {error &&

{error}

} - -

- -

);