diff --git a/src/components/layout/Sidebar/sidebar.jsx b/src/components/layout/Sidebar/sidebar.jsx index 9b57ce3..5d21f75 100644 --- a/src/components/layout/Sidebar/sidebar.jsx +++ b/src/components/layout/Sidebar/sidebar.jsx @@ -23,6 +23,12 @@ const SIDEBAR = { icon: PiCoffee, label: 'مدیریت کافه ها', }, + { + id: 'users-management', + path: '/users-management', + icon: PiCoffee, + label: 'مدیریت کاربران', + }, { id: 'stats', path: '/stats', diff --git a/src/components/layout/layout.jsx b/src/components/layout/layout.jsx index d92c474..cb420e6 100644 --- a/src/components/layout/layout.jsx +++ b/src/components/layout/layout.jsx @@ -7,11 +7,14 @@ import toggleTheme from "../ToggleTheme"; import { CgDarkMode } from "react-icons/cg"; const HEADER_PATHS = [ - { route: "/cafe-management", title: "مدیریت کافه ها" }, - { route: "/dashboard", title: "داشبورد" }, - { route: "/stats", title: "آمار و تحلیل" }, - { route: "/edit-cafe/", title: "ویرایش کافه" }, - + "/management", + "/management/", + "/management/cafes", + "/edit-cafe", + "/edit-cafe/", + "/cafe", + "/cafes", + "/admin", ]; export default function Layout() { diff --git a/src/pages/CafeManagement/CafeManagement.jsx b/src/pages/CafeManagement/CafeManagement.jsx index c8b62eb..a3791a5 100644 --- a/src/pages/CafeManagement/CafeManagement.jsx +++ b/src/pages/CafeManagement/CafeManagement.jsx @@ -68,82 +68,65 @@ const CafeManagement = () => { ); } - return ( - <> - {/* جدول دسکتاپ */} -
- - - - - - - - - - - - - {cafes.map((cafe) => ( - - - - - - - - - ))} - -
- لوگو - - اسم - - آدرس - - ریتینگ - - ساعت کاری - - ادیت -
- {cafe.Name} - - {cafe.Name} - - {cafe.address} - -
- rating - - {cafe.rating || 0} - -
-
-
- time - - {cafe.openinghour || "نامشخص"} - -
-
- - ادیت - - -
-
+ return ( + <> + {/* جدول دسکتاپ */} +
+ + + + + + + + + + + + + {cafes.map((cafe) => ( + + + + + + + + + ))} + +
لوگواسمآدرسریتینگساعت کاریادیت
+ {cafe.Name} + + {cafe.Name} + + {cafe.address} + +
+ rating + {cafe.rating || 0} +
+
+
+ time + + {cafe.openinghour || "نامشخص"} + +
+
+ + ادیت + + +
+
{/* کارت موبایل */}
@@ -181,29 +164,29 @@ const CafeManagement = () => {
- - ادیت کافه - - - - ))} - - - ); - }; + + ادیت کافه + + + + ))} + + + ); + }; - return ( -
- {/* بخش دکمه اضافه کردن */} -
- -
+ return ( +
+ {/* بخش دکمه اضافه کردن */} +
+ +
{/* عنوان */}

diff --git a/src/pages/Stats/Stats.jsx b/src/pages/Stats/Stats.jsx index 8b3fc03..fe08a7a 100644 --- a/src/pages/Stats/Stats.jsx +++ b/src/pages/Stats/Stats.jsx @@ -1,58 +1,106 @@ import React from "react"; import VisitorsChart from "./components/viewstats"; +import CafePopularity from "./components/popular"; +import CafeVisitPie from "./components/mostView"; +import { RiArrowLeftSLine } from "react-icons/ri"; +import { RiArrowDownSLine } from "react-icons/ri"; +import { useState } from "react"; + export default function Stats() { + const [dropDownOpen, setDropdownOpen] = useState(false); return (

آمار بازدید کننده ها

- +
+ + {dropDownOpen && ( +
+
    +
  • امروز
  • +
  • این هفته
  • +
  • این ماه
  • +
  • این سال
  • +
+
+ ) + + } +
+
-
-
- مجموع فروش: 0 تومان +
+
+
+ + راهنما +
+
+ + راهنما +
-
+
-
-
+
+

آمار بازدید کننده ها

- + + همه + +
-
-
- مجموع فروش: 0 تومان +
+
+
+ + راهنما +
+
+ + راهنما +
- +
-
-
+
+

آمار بازدید کننده ها

- + + همه + +
-
-
- مجموع فروش: 0 تومان +
+
+
+ + راهنما +
+
+ + راهنما +
- +
diff --git a/src/pages/Stats/components/mostView.jsx b/src/pages/Stats/components/mostView.jsx new file mode 100644 index 0000000..624d4fa --- /dev/null +++ b/src/pages/Stats/components/mostView.jsx @@ -0,0 +1,48 @@ + + +import { + PieChart, + Pie, + Cell, + ResponsiveContainer, + Tooltip, +} from "recharts"; + +const data = [ + { name: "دان", value: 48, color: "#b52424" }, + { name: "وی", value: 38, color: "#C0BCBC" }, + { name: "آنی", value: 19, color: "#7f7376" }, +]; + +export default function CafeVisitPie() { + return ( +
+ {/*

پربازدیدترین کافه‌ها

*/} + + + + + `${value}%`} + > + {data.map((item, i) => ( + + ))} + + + +
+ ); +} diff --git a/src/pages/Stats/components/popular.jsx b/src/pages/Stats/components/popular.jsx new file mode 100644 index 0000000..7f19e7f --- /dev/null +++ b/src/pages/Stats/components/popular.jsx @@ -0,0 +1,50 @@ +import { + BarChart, + Bar, + XAxis, + Tooltip, + ResponsiveContainer, + Cell, +} from "recharts"; + +const data = [ + { name: "وی", value: 120 }, + { name: "پل", value: 90 }, + { name: "دولت", value: 60 }, + { name: "و", value: 180 }, + { name: "تریح", value: 100 }, + { name: "دان", value: 110 }, +]; + +const colors = ["#efecec", "#efecec", "#efecec", "#7f7376", "#efecec", "#efecec"]; + +export default function CafePopularity() { + return ( +
+ {/*

محبوب‌ترین کافه‌ها

*/} + + + + + + + {data.map((entry, i) => ( + + ))} + + + + +
+ ); +} \ No newline at end of file diff --git a/src/pages/Stats/components/viewstats.jsx b/src/pages/Stats/components/viewstats.jsx index 0a384c9..b6db325 100644 --- a/src/pages/Stats/components/viewstats.jsx +++ b/src/pages/Stats/components/viewstats.jsx @@ -1,65 +1,88 @@ import { - LineChart, - Line, - XAxis, - YAxis, - Tooltip, - ResponsiveContainer, + ComposedChart, + Line, + XAxis, + YAxis, + Tooltip, + ResponsiveContainer, + Area } from "recharts"; const data = [ - { name: "هفته اول", a: 200000, b: 250000 }, - { name: "هفته دوم", a: 450000, b: 380000 }, - { name: "هفته سوم", a: 350000, b: 600000 }, - { name: "هفته چهارم", a: 150000, b: 500000 }, - { name: "هفته پنجم", a: 500000, b: 700000 }, - { name: "هفته ششم", a: 600000, b: 800000 }, - { name: "هفته هفتم", a: 700000, b: 900000 }, - { name: "هفته هشتم", a: 800000, b: 950000 }, - { name: "هفته نهم", a: 900000, b: 1000000 }, + { name: "هفته اول", a: 200000, b: 250000 }, + { name: "هفته دوم", a: 450000, b: 380000 }, + { name: "هفته سوم", a: 350000, b: 600000 }, + { name: "هفته چهارم", a: 150000, b: 500000 }, + { name: "هفته پنجم", a: 500000, b: 700000 }, + { name: "هفته ششم", a: 600000, b: 800000 }, + { name: "هفته هفتم", a: 700000, b: 900000 }, + { name: "هفته هشتم", a: 800000, b: 950000 }, + { name: "هفته نهم", a: 900000, b: 1000000 }, ]; export default function VisitorsChart() { - return ( -
-

آمار بازدید کننده‌ها

+ return ( +
+ + - - - {/* گرادیانت‌ها */} - - - - - + + + + + - - - - - + + + + + - - - - - - - -
- ); + + + + + + + + + + + + + +
+ ); } diff --git a/src/styles/index.css b/src/styles/index.css index 33b9958..f643367 100644 --- a/src/styles/index.css +++ b/src/styles/index.css @@ -72,6 +72,10 @@ select:-webkit-autofill { -webkit-text-fill-color: inherit !important; } +.primary { + color: var(--color-primary); + background-color: var(--color-primary); +} h1, h2, @@ -104,7 +108,7 @@ div:hover } .dark div:hover { - color: var(--color-text2) !important; + color: var(--color-text1); } @@ -179,4 +183,30 @@ svg { /* بک‌گراند انتخاب */ color: var(--color-text1); /* رنگ متن انتخاب */ -} \ No newline at end of file +} + +/* جلوگیری کامل از رینگ / بوردر فوکوس در Recharts */ +.recharts-wrapper:focus, +.recharts-wrapper:focus-visible, +.recharts-surface:focus, +.recharts-surface:focus-visible, +.recharts-responsive-container:focus, +.recharts-responsive-container:focus-visible, +.recharts-layer:focus, +.recharts-layer:focus-visible, +svg:focus, +svg:focus-visible, +g:focus, +g:focus-visible { + outline: none !important; + border: none !important; + box-shadow: none !important; +} + +/* برای اطمینان بیشتر روی کل پروژه */ +*:focus, +*:focus-visible { + outline: none !important; + box-shadow: none !important; +} +