filter search + primary color + logo + ...

This commit is contained in:
hamid zarghami
2025-10-19 16:04:28 +03:30
parent ef0deaf3bd
commit ab2d5ea9a5
54 changed files with 1282 additions and 211 deletions
+13 -10
View File
@@ -1,13 +1,16 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head>
<meta charset="UTF-8" /> <head>
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<title>Vite + React + TS</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head> <title>پنل مدیریت | فجر مرکزی</title>
<body> </head>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script> <body>
</body> <div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html> </html>
+37 -1
View File
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 72 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 72 KiB

+1062 -89
View File
File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 65 KiB

+1 -1
View File
@@ -11,7 +11,7 @@ const Radio: FC<Props> = (props: Props) => {
<div onClick={() => props.onChange(props.value)} className='size-4 cursor-pointer rounded-full bg-[#EAEDF5] flex justify-center items-center'> <div onClick={() => props.onChange(props.value)} className='size-4 cursor-pointer rounded-full bg-[#EAEDF5] flex justify-center items-center'>
{ {
props.isActive && props.isActive &&
<div className='size-2 bg-black rounded-full'></div> <div className='size-2 bg-primary rounded-full'></div>
} }
</div> </div>
) )
+1 -1
View File
@@ -33,7 +33,7 @@ const Tabs: FC<Props> = (props: Props) => {
'flex flex-col max-w-fit mt-[15px] items-center gap-2 cursor-pointer', 'flex flex-col max-w-fit mt-[15px] items-center gap-2 cursor-pointer',
index === 0 && 'pr-[30px]', index === 0 && 'pr-[30px]',
index === props.items.length - 1 && 'pl-[30px]', index === props.items.length - 1 && 'pl-[30px]',
props.active === item.value && 'text-black' props.active === item.value && 'text-primary'
)}> )}>
{item.icon} {item.icon}
<div className='text-xs'> <div className='text-xs'>
+1 -3
View File
@@ -33,7 +33,7 @@ textarea::placeholder {
} }
@theme { @theme {
--color-primary: black; --color-primary: #da2129;
--color-secondary: #f4f5f9; --color-secondary: #f4f5f9;
--color-border: #d0d0d0; --color-border: #d0d0d0;
--color-description: #888888; --color-description: #888888;
@@ -75,7 +75,6 @@ textarea::placeholder {
--color-card-foreground: var(--card-foreground); --color-card-foreground: var(--card-foreground);
--color-popover: var(--popover); --color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground); --color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground); --color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary); --color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground); --color-secondary-foreground: var(--secondary-foreground);
@@ -84,7 +83,6 @@ textarea::placeholder {
--color-accent: var(--accent); --color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground); --color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive); --color-destructive: var(--destructive);
--color-border: var(--border);
--color-input: var(--input); --color-input: var(--input);
--color-ring: var(--ring); --color-ring: var(--ring);
--color-chart-1: var(--chart-1); --color-chart-1: var(--chart-1);
+4 -3
View File
@@ -1,11 +1,12 @@
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
import * as api from "../service/CouponService"; import * as api from "../service/CouponService";
import type { CreateCouponType } from "../types/Types"; import type { CreateCouponType } from "../types/Types";
import { useSharedStore } from "@/shared/store/sharedStore";
export const useGetCoupons = (page: number = 1) => { export const useGetCoupons = (page: number = 1) => {
const { search } = useSharedStore();
return useQuery({ return useQuery({
queryKey: ["coupons", page], queryKey: ["coupons", page, search],
queryFn: () => api.getCoupons(page), queryFn: () => api.getCoupons(page, search),
}); });
}; };
+5 -2
View File
@@ -7,9 +7,12 @@ import type {
} from "../types/Types"; } from "../types/Types";
export const getCoupons = async ( export const getCoupons = async (
page: number = 1 page: number = 1,
search: string
): Promise<CouponsResponse> => { ): Promise<CouponsResponse> => {
const { data } = await axios.get(`/admin/coupon/native?page=${page}`); const { data } = await axios.get(
`/admin/coupon/native?page=${page}&q=${search}`
);
return data; return data;
}; };
+4 -3
View File
@@ -7,11 +7,12 @@ import type {
UpdateBlogType, UpdateBlogType,
BlogCategoriesResponse, BlogCategoriesResponse,
} from "../types/Types"; } from "../types/Types";
import { useSharedStore } from "@/shared/store/sharedStore";
export const useGetBlogs = (page: number = 1) => { export const useGetBlogs = (page: number = 1) => {
const { search } = useSharedStore();
return useQuery<GetBlogsResult>({ return useQuery<GetBlogsResult>({
queryKey: ["blogs", page], queryKey: ["blogs", page, search],
queryFn: () => api.getBlogs(page), queryFn: () => api.getBlogs(page, search),
}); });
}; };
+7 -2
View File
@@ -9,8 +9,13 @@ import type {
BlogDetailResponse, BlogDetailResponse,
} from "../types/Types"; } from "../types/Types";
export const getBlogs = async (page: number = 1): Promise<GetBlogsResult> => { export const getBlogs = async (
const { data } = await axios.get<BlogsResponse>(`/blogs?page=${page}`); page: number = 1,
search: string
): Promise<GetBlogsResult> => {
const { data } = await axios.get<BlogsResponse>(
`/blogs?page=${page}&q=${search}`
);
return data.results; return data.results;
}; };
+4 -2
View File
@@ -1,10 +1,12 @@
import { useMutation, useQuery } from "@tanstack/react-query"; import { useMutation, useQuery } from "@tanstack/react-query";
import * as api from "../service/BrandService"; import * as api from "../service/BrandService";
import { useSharedStore } from "@/shared/store/sharedStore";
export const useGetBrands = (page: number = 1, limit: number = 10) => { export const useGetBrands = (page: number = 1, limit: number = 10) => {
const { search } = useSharedStore();
return useQuery({ return useQuery({
queryKey: ["brands", page, limit], queryKey: ["brands", page, limit, search],
queryFn: () => api.getBrands(page, limit), queryFn: () => api.getBrands(page, limit, search),
}); });
}; };
+2 -2
View File
@@ -2,9 +2,9 @@ import axios from "../../../config/axios";
import { type BrandsResponseType, type CreateBrandType } from "../types/Types"; import { type BrandsResponseType, type CreateBrandType } from "../types/Types";
import { type IBrandResponse } from "../../../types/response.types"; import { type IBrandResponse } from "../../../types/response.types";
export const getBrands = async (page: number = 1, limit: number = 10): Promise<BrandsResponseType> => { export const getBrands = async (page: number = 1, limit: number = 10, search: string): Promise<BrandsResponseType> => {
const { data } = await axios.get(`/brand`, { const { data } = await axios.get(`/brand`, {
params: { page, limit } params: { page, limit, q: search }
}); });
return data; return data;
}; };
+4 -2
View File
@@ -1,6 +1,7 @@
import { useMutation, useQuery } from '@tanstack/react-query'; import { useMutation, useQuery } from '@tanstack/react-query';
import * as api from '../service/CategoryService'; import * as api from '../service/CategoryService';
import { type CategoryType, type CreateCategoryAttributeType, type CategoryAttributesResponseType } from '../types/Types'; import { type CategoryType, type CreateCategoryAttributeType, type CategoryAttributesResponseType } from '../types/Types';
import { useSharedStore } from '@/shared/store/sharedStore';
export const useCreateCategory = () => { export const useCreateCategory = () => {
return useMutation({ return useMutation({
@@ -9,9 +10,10 @@ export const useCreateCategory = () => {
}; };
export const useGetCategories = () => { export const useGetCategories = () => {
const { search } = useSharedStore();
return useQuery({ return useQuery({
queryKey: ['categories'], queryKey: ['categories', search],
queryFn: api.getCategories, queryFn: () => api.getCategories(search),
}); });
}; };
@@ -6,8 +6,8 @@ export const createCategory = async (params: CategoryType) => {
return data; return data;
}; };
export const getCategories = async (): Promise<CategoriesResponseType> => { export const getCategories = async (search: string): Promise<CategoriesResponseType> => {
const { data } = await axios.get(`/category`); const { data } = await axios.get(`/category?q=${search}`);
return data; return data;
}; };
+7 -4
View File
@@ -1,13 +1,15 @@
import { useMutation, useQuery } from "@tanstack/react-query"; import { useMutation, useQuery } from "@tanstack/react-query";
import * as api from "../service/OrderService"; import * as api from "../service/OrderService";
import { useSharedStore } from "@/shared/store/sharedStore";
export const useGetNativeOrders = ( export const useGetNativeOrders = (
page: number = 1, page: number = 1,
status: string = "all" status: string = "all"
) => { ) => {
const { search } = useSharedStore();
const { data, isLoading, error } = useQuery({ const { data, isLoading, error } = useQuery({
queryKey: ["orders", page, status], queryKey: ["orders", page, status, search],
queryFn: () => api.getNativeOrders(page, status), queryFn: () => api.getNativeOrders(page, status, search),
}); });
return { data, isLoading, error }; return { data, isLoading, error };
}; };
@@ -16,9 +18,10 @@ export const useGetSellerOrders = (
page: number = 1, page: number = 1,
status: string = "all" status: string = "all"
) => { ) => {
const { search } = useSharedStore();
const { data, isLoading, error } = useQuery({ const { data, isLoading, error } = useQuery({
queryKey: ["orders", page, status], queryKey: ["orders", page, status, search],
queryFn: () => api.getSellerOrders(page, status), queryFn: () => api.getSellerOrders(page, status, search),
}); });
return { data, isLoading, error }; return { data, isLoading, error };
}; };
+6 -4
View File
@@ -10,20 +10,22 @@ import type {
export const getNativeOrders = async ( export const getNativeOrders = async (
page: number = 1, page: number = 1,
status: string status: string,
search: string
): Promise<NativeOrdersResponseType> => { ): Promise<NativeOrdersResponseType> => {
const { data } = await axios.get("/admin/orders/native", { const { data } = await axios.get("/admin/orders/native", {
params: { page, status }, params: { page, status, q: search },
}); });
return data; return data;
}; };
export const getSellerOrders = async ( export const getSellerOrders = async (
page: number = 1, page: number = 1,
status: string status: string,
search: string
): Promise<NativeOrdersResponseType> => { ): Promise<NativeOrdersResponseType> => {
const { data } = await axios.get("/admin/orders/seller", { const { data } = await axios.get("/admin/orders/seller", {
params: { page, status }, params: { page, status, q: search },
}); });
return data; return data;
}; };
+1 -1
View File
@@ -89,7 +89,7 @@ const List: FC = () => {
<tbody> <tbody>
{products.length === 0 ? ( {products.length === 0 ? (
<tr className='tr'> <tr className='tr'>
<td colSpan={8} className="text-center py-8 text-gray-500"> <td colSpan={9} className="text-center py-8 text-gray-500">
هیچ محصولی یافت نشد هیچ محصولی یافت نشد
</td> </td>
</tr> </tr>
+4 -2
View File
@@ -9,6 +9,7 @@ import {
type UpdateProductAttributeRequestType, type UpdateProductAttributeRequestType,
type UpdateProductRequestType type UpdateProductRequestType
} from "../types/Types"; } from "../types/Types";
import { useSharedStore } from '@/shared/store/sharedStore';
export const useCreateProductDetail = () => { export const useCreateProductDetail = () => {
return useMutation({ return useMutation({
@@ -29,9 +30,10 @@ export const useSaveProduct = () => {
}; };
export const useGetProducts = (page: number = 1, limit: number = 10) => { export const useGetProducts = (page: number = 1, limit: number = 10) => {
const { search } = useSharedStore();
return useQuery({ return useQuery({
queryKey: ['products', page, limit], queryKey: ['products', page, limit, search],
queryFn: () => api.getProducts(page, limit), queryFn: () => api.getProducts(page, limit, search),
}); });
}; };
+1 -1
View File
@@ -62,7 +62,7 @@ const SellerList: FC = () => {
<tbody> <tbody>
{sellers.length === 0 ? ( {sellers.length === 0 ? (
<tr className='tr'> <tr className='tr'>
<td colSpan={9} className="text-center py-8 text-gray-500"> <td colSpan={10} className="text-center py-8 text-gray-500">
هیچ فروشندهای یافت نشد هیچ فروشندهای یافت نشد
</td> </td>
</tr> </tr>
+4 -2
View File
@@ -5,11 +5,13 @@ import type {
CreateCategoryLearning, CreateCategoryLearning,
CreateLearningType, CreateLearningType,
} from "../types/Types"; } from "../types/Types";
import { useSharedStore } from "@/shared/store/sharedStore";
export const useGetSellers = (page: number = 1, enabled: boolean = true) => { export const useGetSellers = (page: number = 1, enabled: boolean = true) => {
const { search } = useSharedStore();
return useQuery({ return useQuery({
queryKey: ["sellers", page], queryKey: ["sellers", page, search],
queryFn: () => api.getSellers(page), queryFn: () => api.getSellers(page, search),
enabled, enabled,
}); });
}; };
+3 -2
View File
@@ -16,9 +16,10 @@ import type {
} from "../types/Types"; } from "../types/Types";
export const getSellers = async ( export const getSellers = async (
page: number = 1 page: number = 1,
search: string
): Promise<SellersResponse> => { ): Promise<SellersResponse> => {
const { data } = await axios.get(`/admin/sellers?page=${page}`); const { data } = await axios.get(`/admin/sellers?page=${page}&q=${search}`);
return data; return data;
}; };
+4 -2
View File
@@ -1,9 +1,11 @@
import { useQuery } from "@tanstack/react-query"; import { useQuery } from "@tanstack/react-query";
import * as api from "../service/UserService"; import * as api from "../service/UserService";
import { useSharedStore } from "@/shared/store/sharedStore";
export const useGetUsers = (page: number = 1, limit: number = 10) => { export const useGetUsers = (page: number = 1, limit: number = 10) => {
const { search } = useSharedStore();
return useQuery({ return useQuery({
queryKey: ["users", page, limit], queryKey: ["users", page, limit, search],
queryFn: () => api.getUsers(page, limit), queryFn: () => api.getUsers(page, limit, search),
}); });
}; };
+3 -2
View File
@@ -4,10 +4,11 @@ import type { UserResponse } from "../types/Types";
export const getUsers = async ( export const getUsers = async (
page: number = 1, page: number = 1,
limit: number = 10 limit: number = 10,
search: string
): Promise<UserResponse> => { ): Promise<UserResponse> => {
const { data } = await axios.get("/admin/users", { const { data } = await axios.get("/admin/users", {
params: { page, limit }, params: { page, limit, q: search },
}); });
return data; return data;
}; };
+13 -7
View File
@@ -1,9 +1,9 @@
import { type FC } from 'react' import { type FC, useEffect } from 'react'
import Input from '../components/Input' import Input from '../components/Input'
// import { ArrowDown2, CloseCircle, HambergerMenu, Logout, Wallet } from 'iconsax-react' // import { ArrowDown2, CloseCircle, HambergerMenu, Logout, Wallet } from 'iconsax-react'
// import AvatarImage from '../assets/images/avatar_image.png' // import AvatarImage from '../assets/images/avatar_image.png'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { Link } from 'react-router-dom' import { Link, useLocation } from 'react-router-dom'
import { Pages } from '../config/Pages' import { Pages } from '../config/Pages'
import { useSharedStore } from './store/sharedStore' import { useSharedStore } from './store/sharedStore'
import { HambergerMenu, Wallet } from 'iconsax-react' import { HambergerMenu, Wallet } from 'iconsax-react'
@@ -13,7 +13,8 @@ const Header: FC = () => {
// const location = useLocation(); // const location = useLocation();
// const [popoverKey, setPopoverKey] = useState(0); // const [popoverKey, setPopoverKey] = useState(0);
const { t } = useTranslation('global') const { t } = useTranslation('global')
const { setOpenSidebar, openSidebar, hasSubMenu } = useSharedStore() const { setOpenSidebar, openSidebar, hasSubMenu, setSearch } = useSharedStore()
const location = useLocation()
// useEffect(() => { // useEffect(() => {
// setPopoverKey((prevKey) => prevKey + 1); // setPopoverKey((prevKey) => prevKey + 1);
@@ -25,6 +26,10 @@ const Header: FC = () => {
// window.location.href = Pages.auth.login // window.location.href = Pages.auth.login
// } // }
useEffect(() => {
setSearch('')
}, [location.pathname])
return ( return (
<div className={`fixed z-10 right-4 left-4 top-4 xl:h-16 h-12 flex items-center px-6 bg-white justify-between rounded-[32px] ${hasSubMenu ? 'xl:right-[320px] xl:w-[calc(100%-340px)]' : 'xl:right-[285px] xl:w-[calc(100%-305px)]'}`}> <div className={`fixed z-10 right-4 left-4 top-4 xl:h-16 h-12 flex items-center px-6 bg-white justify-between rounded-[32px] ${hasSubMenu ? 'xl:right-[320px] xl:w-[calc(100%-340px)]' : 'xl:right-[285px] xl:w-[calc(100%-305px)]'}`}>
@@ -32,15 +37,16 @@ const Header: FC = () => {
<Input <Input
variant='search' variant='search'
placeholder={t('header.search')} placeholder={t('header.search')}
onChangeSearchFinal={(value) => setSearch(value)}
/> />
</div> </div>
<div onClick={() => setOpenSidebar(!openSidebar)} className='xl:hidden block'> <div onClick={() => setOpenSidebar(!openSidebar)} className='xl:hidden block'>
<HambergerMenu size={24} color='black' /> <HambergerMenu size={24} color='#da2129' />
</div> </div>
{/* <img src={LogoImage} className='h-6 xl:hidden block absolute right-0 left-0 mx-auto' /> */} {/* <img src={LogoImage} className='h-6 xl:hidden block absolute right-0 left-0 mx-auto' /> */}
<div className='flex xl:gap-6 gap-4 items-center'> <div className='flex xl:gap-6 gap-4 items-center'>
<Link className='xl:hidden' to={Pages.wallet}> <Link className='xl:hidden' to={Pages.wallet}>
<Wallet className='xl:size-[18px] size-[17px]' color='black' /> <Wallet className='xl:size-[18px] size-[17px]' color='#da2129' />
</Link> </Link>
{/* <Notifications /> */} {/* <Notifications /> */}
{/* { {/* {
@@ -62,7 +68,7 @@ const Header: FC = () => {
<PopoverPanel style={{ minHeight: window.innerWidth < 1140 ? window.innerHeight : undefined }} anchor="bottom" className="flex xl:ml-6 overflow-auto flex-col gap-3 bg-white boxShadow xl:mt-7 z-30 py-4 text-xs rounded-2.5 xl:w-[300px] -mt-[50px] w-full fixed xl:h-fit h-full shadow-md"> <PopoverPanel style={{ minHeight: window.innerWidth < 1140 ? window.innerHeight : undefined }} anchor="bottom" className="flex xl:ml-6 overflow-auto flex-col gap-3 bg-white boxShadow xl:mt-7 z-30 py-4 text-xs rounded-2.5 xl:w-[300px] -mt-[50px] w-full fixed xl:h-fit h-full shadow-md">
<div className='absolute xl:hidden top-6 left-6'> <div className='absolute xl:hidden top-6 left-6'>
<CloseCircle onClick={() => setPopoverKey((prevKey) => prevKey + 1)} size={20} color='black' /> <CloseCircle onClick={() => setPopoverKey((prevKey) => prevKey + 1)} size={20} color='#da2129' />
</div> </div>
<Link to={Pages.profile} className='flex flex-col gap-2 items-center justify-center border-b border-[#EAEDF5] pb-4'> <Link to={Pages.profile} className='flex flex-col gap-2 items-center justify-center border-b border-[#EAEDF5] pb-4'>
<div className='size-14 rounded-full overflow-hidden'> <div className='size-14 rounded-full overflow-hidden'>
@@ -80,7 +86,7 @@ const Header: FC = () => {
<div className='px-6 mt-2'> <div className='px-6 mt-2'>
<div onClick={() => handleLogout()} className='flex gap-2 items-center cursor-pointer'> <div onClick={() => handleLogout()} className='flex gap-2 items-center cursor-pointer'>
<Logout size={20} color='black' /> <Logout size={20} color='#da2129' />
<div> <div>
{t('sidebar.logout')} {t('sidebar.logout')}
</div> </div>
+18 -18
View File
@@ -106,7 +106,7 @@ const SideBar: FC = () => {
<div className='text-xs text-[#8C90A3]'> <div className='text-xs text-[#8C90A3]'>
{/* داشبورد */} {/* داشبورد */}
<SideBarItem <SideBarItem
icon={<Home2 variant={isActive('dashboard') ? 'Bold' : 'Outline'} color={isActive('dashboard') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<Home2 variant={isActive('dashboard') ? 'Bold' : 'Outline'} color={isActive('dashboard') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="داشبورد" title="داشبورد"
isActive={isActive('dashboard')} isActive={isActive('dashboard')}
link="/dashboard" link="/dashboard"
@@ -115,7 +115,7 @@ const SideBar: FC = () => {
{/* محصولات */} {/* محصولات */}
<SideBarItem <SideBarItem
icon={<Element3 variant={isActive('products') ? 'Bold' : 'Outline'} color={isActive('products') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<Element3 variant={isActive('products') ? 'Bold' : 'Outline'} color={isActive('products') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="محصولات" title="محصولات"
isActive={isActive('products')} isActive={isActive('products')}
link={Pages.products.list} link={Pages.products.list}
@@ -124,7 +124,7 @@ const SideBar: FC = () => {
{/* سفارشات */} {/* سفارشات */}
<SideBarItem <SideBarItem
icon={<Receipt21 variant={isActive('orders') ? 'Bold' : 'Outline'} color={isActive('orders') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<Receipt21 variant={isActive('orders') ? 'Bold' : 'Outline'} color={isActive('orders') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="سفارشات" title="سفارشات"
isActive={isActive('orders')} isActive={isActive('orders')}
link="/orders" link="/orders"
@@ -133,7 +133,7 @@ const SideBar: FC = () => {
{/* تخفیف ها */} {/* تخفیف ها */}
<SideBarItem <SideBarItem
icon={<TicketDiscount variant={isActive('coupon') ? 'Bold' : 'Outline'} color={isActive('coupon') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<TicketDiscount variant={isActive('coupon') ? 'Bold' : 'Outline'} color={isActive('coupon') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="تخفیف ها" title="تخفیف ها"
isActive={isActive('coupon')} isActive={isActive('coupon')}
link={Pages.coupon.list} link={Pages.coupon.list}
@@ -142,7 +142,7 @@ const SideBar: FC = () => {
{/* بلاگ */} {/* بلاگ */}
<SideBarItem <SideBarItem
icon={<DocumentText variant={isActive('blog') ? 'Bold' : 'Outline'} color={isActive('blog') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<DocumentText variant={isActive('blog') ? 'Bold' : 'Outline'} color={isActive('blog') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="بلاگ" title="بلاگ"
isActive={isActive('blog')} isActive={isActive('blog')}
link="/blog" link="/blog"
@@ -151,7 +151,7 @@ const SideBar: FC = () => {
{/* روش های ارسال */} {/* روش های ارسال */}
<SideBarItem <SideBarItem
icon={<Truck variant={isActive('shipment') ? 'Bold' : 'Outline'} color={isActive('shipment') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<Truck variant={isActive('shipment') ? 'Bold' : 'Outline'} color={isActive('shipment') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="روش های ارسال" title="روش های ارسال"
isActive={isActive('shipment')} isActive={isActive('shipment')}
link={Pages.shipment.list} link={Pages.shipment.list}
@@ -160,7 +160,7 @@ const SideBar: FC = () => {
{/* مالی */} {/* مالی */}
<SideBarItem <SideBarItem
icon={<Money3 variant={isActive('financial') ? 'Bold' : 'Outline'} color={isActive('financial') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<Money3 variant={isActive('financial') ? 'Bold' : 'Outline'} color={isActive('financial') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="مالی" title="مالی"
isActive={isActive('financial')} isActive={isActive('financial')}
link={Pages.financial.list} link={Pages.financial.list}
@@ -169,7 +169,7 @@ const SideBar: FC = () => {
{/* فروشندگان */} {/* فروشندگان */}
<SideBarItem <SideBarItem
icon={<People variant={isActive('sellers') ? 'Bold' : 'Outline'} color={isActive('sellers') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<People variant={isActive('sellers') ? 'Bold' : 'Outline'} color={isActive('sellers') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="فروشندگان" title="فروشندگان"
isActive={isActive('sellers')} isActive={isActive('sellers')}
link={Pages.sellers.list} link={Pages.sellers.list}
@@ -178,7 +178,7 @@ const SideBar: FC = () => {
{/* خریداران */} {/* خریداران */}
<SideBarItem <SideBarItem
icon={<UserSquare variant={isActive('buy-users') ? 'Bold' : 'Outline'} color={isActive('buy-users') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<UserSquare variant={isActive('buy-users') ? 'Bold' : 'Outline'} color={isActive('buy-users') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="خریداران" title="خریداران"
isActive={isActive('buy-users')} isActive={isActive('buy-users')}
link={Pages.buyUsers.list} link={Pages.buyUsers.list}
@@ -187,7 +187,7 @@ const SideBar: FC = () => {
{/* کاربران */} {/* کاربران */}
<SideBarItem <SideBarItem
icon={<Profile variant={isActive('admin') ? 'Bold' : 'Outline'} color={isActive('admin') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<Profile variant={isActive('admin') ? 'Bold' : 'Outline'} color={isActive('admin') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="ادمین ها" title="ادمین ها"
isActive={isActive('admin')} isActive={isActive('admin')}
link={Pages.admin.list} link={Pages.admin.list}
@@ -196,7 +196,7 @@ const SideBar: FC = () => {
{/* تیکت ها */} {/* تیکت ها */}
<SideBarItem <SideBarItem
icon={<Messages3 variant={isActive('tickets') ? 'Bold' : 'Outline'} color={isActive('tickets') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<Messages3 variant={isActive('tickets') ? 'Bold' : 'Outline'} color={isActive('tickets') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="تیکت ها" title="تیکت ها"
isActive={isActive('tickets')} isActive={isActive('tickets')}
link={Pages.ticket.list} link={Pages.ticket.list}
@@ -205,7 +205,7 @@ const SideBar: FC = () => {
{/* گزارش ها */} {/* گزارش ها */}
<SideBarItem <SideBarItem
icon={<Chart variant={isActive('reports') ? 'Bold' : 'Outline'} color={isActive('reports') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<Chart variant={isActive('reports') ? 'Bold' : 'Outline'} color={isActive('reports') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="گزارش ها" title="گزارش ها"
isActive={isActive('reports')} isActive={isActive('reports')}
link={Pages.report.product} link={Pages.report.product}
@@ -214,7 +214,7 @@ const SideBar: FC = () => {
{/* گفت و گو */} {/* گفت و گو */}
<SideBarItem <SideBarItem
icon={<SmsTracking variant={isActive('chat') ? 'Bold' : 'Outline'} color={isActive('chat') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<SmsTracking variant={isActive('chat') ? 'Bold' : 'Outline'} color={isActive('chat') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="گفت و گو" title="گفت و گو"
isActive={isActive('chat')} isActive={isActive('chat')}
link={Pages.messages.list} link={Pages.messages.list}
@@ -223,7 +223,7 @@ const SideBar: FC = () => {
{/* ارتباط با ما */} {/* ارتباط با ما */}
<SideBarItem <SideBarItem
icon={<Headphone variant={isActive('contact') ? 'Bold' : 'Outline'} color={isActive('contact') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<Headphone variant={isActive('contact') ? 'Bold' : 'Outline'} color={isActive('contact') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="ارتباط با ما" title="ارتباط با ما"
isActive={isActive('contact')} isActive={isActive('contact')}
link={Pages.contactUs.list} link={Pages.contactUs.list}
@@ -232,7 +232,7 @@ const SideBar: FC = () => {
{/* تنظیمات */} {/* تنظیمات */}
<SideBarItem <SideBarItem
icon={<Setting2 variant={isActive('settings') ? 'Bold' : 'Outline'} color={isActive('settings') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<Setting2 variant={isActive('settings') ? 'Bold' : 'Outline'} color={isActive('settings') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="تنظیمات" title="تنظیمات"
isActive={isActive('settings')} isActive={isActive('settings')}
link="/settings" link="/settings"
@@ -241,7 +241,7 @@ const SideBar: FC = () => {
{/* مدیریت صفحات */} {/* مدیریت صفحات */}
<SideBarItem <SideBarItem
icon={<DocumentText variant={isActive('pages') ? 'Bold' : 'Outline'} color={isActive('pages') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<DocumentText variant={isActive('pages') ? 'Bold' : 'Outline'} color={isActive('pages') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="مدیریت صفحات" title="مدیریت صفحات"
isActive={isActive('pages')} isActive={isActive('pages')}
link={Pages.pages.aboutUs} link={Pages.pages.aboutUs}
@@ -250,7 +250,7 @@ const SideBar: FC = () => {
{/* مشاغل */} {/* مشاغل */}
<SideBarItem <SideBarItem
icon={<Briefcase variant={isActive('jobs') ? 'Bold' : 'Outline'} color={isActive('jobs') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<Briefcase variant={isActive('jobs') ? 'Bold' : 'Outline'} color={isActive('jobs') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="مشاغل" title="مشاغل"
isActive={isActive('jobs')} isActive={isActive('jobs')}
link={Pages.jobs.list} link={Pages.jobs.list}
@@ -261,7 +261,7 @@ const SideBar: FC = () => {
<div className='flex-1 flex flex-col justify-end mt-14'> <div className='flex-1 flex flex-col justify-end mt-14'>
<div className='text-xs text-[#8C90A3]'> <div className='text-xs text-[#8C90A3]'>
<SideBarItem <SideBarItem
icon={<Logout variant={isActive('logout') ? 'Bold' : 'Outline'} color={isActive('logout') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />} icon={<Logout variant={isActive('logout') ? 'Bold' : 'Outline'} color={isActive('logout') ? '#da2129' : '#8C90A3'} size={iconSizeSideBar} />}
title="خروج" title="خروج"
isActive={isActive('logout')} isActive={isActive('logout')}
link={`#`} link={`#`}
+2 -2
View File
@@ -40,7 +40,7 @@ const SideBarItem: FC<Props> = (props: Props) => {
hasSubMenu && 'flex-col', hasSubMenu && 'flex-col',
)}> )}>
<div className={clx( <div className={clx(
'w-1 bg-black h-6', 'w-1 bg-primary h-6',
!props.isActive && 'invisible', !props.isActive && 'invisible',
hasSubMenu && 'hidden', hasSubMenu && 'hidden',
)}></div> )}></div>
@@ -49,7 +49,7 @@ const SideBarItem: FC<Props> = (props: Props) => {
hasSubMenu && 'flex-col text-[10px]', hasSubMenu && 'flex-col text-[10px]',
)}> )}>
{props.icon} {props.icon}
<div className={props.isActive ? 'text-black' : ''}> <div className={props.isActive ? 'text-primary' : ''}>
{props.title} {props.title}
</div> </div>
</div> </div>
+1 -1
View File
@@ -17,7 +17,7 @@ const BlogSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<DocumentText <DocumentText
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -15,7 +15,7 @@ const BuyersSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<UserSquare <UserSquare
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -15,7 +15,7 @@ const CategorySubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<Element3 <Element3
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -14,7 +14,7 @@ const ChatSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<SmsTracking <SmsTracking
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -15,7 +15,7 @@ const ContactSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<Headphone <Headphone
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -17,7 +17,7 @@ const CustomerSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b pb-10 px-6'> <div className='flex gap-3 items-center border-b pb-10 px-6'>
<People <People
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -14,7 +14,7 @@ const DashboardSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<Home2 <Home2
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -15,7 +15,7 @@ const FinancialSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<Money3 <Money3
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -14,7 +14,7 @@ const JobsSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<Briefcase <Briefcase
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -19,7 +19,7 @@ const LearningSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b pb-10 px-6'> <div className='flex gap-3 items-center border-b pb-10 px-6'>
<Teacher <Teacher
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -13,7 +13,7 @@ const OrdersSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<Receipt21 <Receipt21
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -15,7 +15,7 @@ const PagesSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<DocumentText <DocumentText
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -15,7 +15,7 @@ const ProductsSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<Element3 <Element3
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -19,7 +19,7 @@ const ReceiptSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b pb-10 px-6'> <div className='flex gap-3 items-center border-b pb-10 px-6'>
<Receipt21 <Receipt21
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -15,7 +15,7 @@ const ReportsSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<Chart <Chart
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -15,7 +15,7 @@ const SellersSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<People <People
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -20,7 +20,7 @@ const ServicesSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b pb-10 px-6'> <div className='flex gap-3 items-center border-b pb-10 px-6'>
<Element3 <Element3
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -15,7 +15,7 @@ const SettingsSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<Setting2 <Setting2
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -14,7 +14,7 @@ const ShippingSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<Truck <Truck
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+2 -2
View File
@@ -15,13 +15,13 @@ const SubMenuItem: FC<Props> = (props: Props) => {
'flex text-xs gap-6 mt-1', 'flex text-xs gap-6 mt-1',
)}> )}>
<div className={clx( <div className={clx(
'w-1 bg-black h-6', 'w-1 bg-primary h-6',
!props.isActive && 'invisible', !props.isActive && 'invisible',
)}></div> )}></div>
<div className={clx( <div className={clx(
'flex gap-3 items-center mt-1', 'flex gap-3 items-center mt-1',
)}> )}>
<div className={props.isActive ? 'text-black' : 'text-description'}> <div className={props.isActive ? 'text-primary' : 'text-description'}>
{props.title} {props.title}
</div> </div>
</div> </div>
+1 -1
View File
@@ -20,7 +20,7 @@ const SupportSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b pb-10 px-6'> <div className='flex gap-3 items-center border-b pb-10 px-6'>
<Headphone <Headphone
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -20,7 +20,7 @@ const TicketSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b pb-10 px-6'> <div className='flex gap-3 items-center border-b pb-10 px-6'>
<Messages3 <Messages3
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -15,7 +15,7 @@ const TicketsSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b border-border pb-10 px-6'> <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
<Messages3 <Messages3
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
@@ -16,7 +16,7 @@ const TransactionsSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b pb-10 px-6'> <div className='flex gap-3 items-center border-b pb-10 px-6'>
<Card <Card
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+1 -1
View File
@@ -15,7 +15,7 @@ const UsersSubMenu: FC = () => {
<div className='flex gap-3 items-center border-b pb-10 px-6'> <div className='flex gap-3 items-center border-b pb-10 px-6'>
<Profile <Profile
size={24} size={24}
color='#000' color='#da2129'
variant='Bold' variant='Bold'
/> />
<div className='text-xs'> <div className='text-xs'>
+2
View File
@@ -8,4 +8,6 @@ export const useSharedStore = create<SharedStoreType>((set) => ({
setSubtMenu: (value: boolean) => set({ hasSubMenu: value }), setSubtMenu: (value: boolean) => set({ hasSubMenu: value }),
subMenuName: "", subMenuName: "",
setSubMenuName: (value: string) => set({ subMenuName: value }), setSubMenuName: (value: string) => set({ subMenuName: value }),
search: "",
setSearch: (value: string) => set({ search: value }),
})); }));
+2
View File
@@ -5,6 +5,8 @@ export type SharedStoreType = {
setSubtMenu: (value: boolean) => void; setSubtMenu: (value: boolean) => void;
subMenuName: string; subMenuName: string;
setSubMenuName: (value: string) => void; setSubMenuName: (value: string) => void;
search: string;
setSearch: (value: string) => void;
}; };
export type PagerType = { export type PagerType = {