diff --git a/src/app/account/page.tsx b/src/app/account/page.tsx index a067ad3..8e93a69 100644 --- a/src/app/account/page.tsx +++ b/src/app/account/page.tsx @@ -23,6 +23,7 @@ import AccountProfile from "../../components/AccountProfile"; import AccountSecurity from "../../components/AccountSecurity"; import AccountNotifications from "../../components/AccountNotifications"; import AccountAgentTransactionSection from "../../components/AccountAgentTransactionSection"; +import TabsNav from "../../components/TabsNav"; const initialNotifications = { emailNotifications: true, @@ -54,22 +55,7 @@ export default function AccountPage() {

Аккаунт

- +
{activeTab === "profile" && ( diff --git a/src/app/stat/page.tsx b/src/app/stat/page.tsx index a50c5da..49b8d91 100644 --- a/src/app/stat/page.tsx +++ b/src/app/stat/page.tsx @@ -8,6 +8,7 @@ import styles from "../../styles/stat.module.css"; import DateInput from "../../components/DateInput"; import DateFilters from "../../components/DateFilters"; import AuthGuard from "../../components/AuthGuard"; +import TabsNav from "../../components/TabsNav"; const tabs = [ { id: "agents", label: "Агенты" }, @@ -40,17 +41,7 @@ export default function StatPage() {

Статистика и аналитика

{/* */}
-
- {tabs.map((tab) => ( - - ))} -
+ = ({ label, value, onChange, min, max }) => (
- +
+ + { + const inputElement = e.currentTarget.previousElementSibling as HTMLInputElement; + if (inputElement && typeof inputElement.showPicker === 'function') { + inputElement.showPicker(); + } else { + inputElement.focus(); + } + }} + /> +
); diff --git a/src/components/Navigation.tsx b/src/components/Navigation.tsx index c331105..579fabb 100644 --- a/src/components/Navigation.tsx +++ b/src/components/Navigation.tsx @@ -5,6 +5,8 @@ import styles from "../styles/navigation.module.css"; import Cookies from "js-cookie"; import { useEffect, useState } from "react"; import { useUser } from "./UserContext"; +import TabsNav from "./TabsNav"; +import { useRouter } from "next/navigation"; interface NavItem { id: string; @@ -22,6 +24,7 @@ const Navigation: React.FC = () => { const pathname = usePathname(); const [login, setLogin] = useState(""); const { firstName, surname } = useUser(); + const router = useRouter(); useEffect(() => { if (typeof document !== "undefined") { @@ -30,25 +33,21 @@ const Navigation: React.FC = () => { } }, []); + const handleNavigationChange = (tabId: string) => { + if (tabId === "home") { + router.push("/"); + } else if (tabId === "stat") { + router.push("/stat"); + } else if (tabId === "billing") { + router.push("/billing"); + } + }; + if (pathname === "/auth") return null; return (