From 75f2f0ab17a8f987e6c48ecc2b1e95a8426dbdd7 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Wed, 15 Oct 2025 14:43:02 +0330 Subject: [PATCH] fix bug --- .cursor/commands/navtive.md | 0 src/components/DatePicker.tsx | 2 + src/components/PageTitle.tsx | 8 +- src/config/Pages.ts | 4 +- src/pages/Coupon/Create.tsx | 1 + src/pages/brand/Create.tsx | 3 +- src/pages/brand/Update.tsx | 3 +- src/pages/category/Create.tsx | 45 ++-- src/pages/category/Update.tsx | 50 ++-- src/pages/category/types/Types.ts | 2 +- src/pages/orders/Native.tsx | 3 +- .../products/components/CreateVariant.tsx | 2 +- .../products/components/UpdateVariant.tsx | 2 +- .../components/CreateReportCategoryModal.tsx | 8 +- .../components/ProductRequestDetailModal.tsx | 223 +++++++++++++++++- .../components/WholesaleRequestTableRow.tsx | 4 +- src/pages/ticket/TicketsList.tsx | 7 - src/shared/SideBar.tsx | 16 +- src/shared/components/BlogSubMenu.tsx | 4 +- src/shared/components/OrdersSubMenu.tsx | 2 +- src/shared/components/ReportsSubMenu.tsx | 5 - src/shared/components/SellersSubMenu.tsx | 2 +- src/shared/components/UsersSubMenu.tsx | 4 +- 23 files changed, 299 insertions(+), 101 deletions(-) create mode 100644 .cursor/commands/navtive.md diff --git a/.cursor/commands/navtive.md b/.cursor/commands/navtive.md new file mode 100644 index 0000000..e69de29 diff --git a/src/components/DatePicker.tsx b/src/components/DatePicker.tsx index 3598f56..7a26d04 100644 --- a/src/components/DatePicker.tsx +++ b/src/components/DatePicker.tsx @@ -15,6 +15,7 @@ type Props = { className?: string; label: string, readOnly?: boolean; + minDate?: Date; }; const DatePickerComponent: FC = (props: Props) => { @@ -63,6 +64,7 @@ const DatePickerComponent: FC = (props: Props) => { calendarPosition="bottom-right" className={props.className} readOnly={props.readOnly} + minDate={props.minDate} /> {props.error_text && props.error_text !== '' && (
diff --git a/src/components/PageTitle.tsx b/src/components/PageTitle.tsx index fd72e34..5cb23df 100644 --- a/src/components/PageTitle.tsx +++ b/src/components/PageTitle.tsx @@ -3,11 +3,15 @@ import { useLocation } from 'react-router-dom' import TitleLine from './TitleLine' import { getPageTitle } from '../config/PageTitles' -const PageTitle: FC = () => { +type Props = { + title1?: string +} + +const PageTitle: FC = ({ title1 }) => { const location = useLocation() const title = getPageTitle(location.pathname) - return + return } export default PageTitle diff --git a/src/config/Pages.ts b/src/config/Pages.ts index 59f342e..bc9dc43 100644 --- a/src/config/Pages.ts +++ b/src/config/Pages.ts @@ -171,7 +171,7 @@ export const Pages = { orders: { native: "/orders/native", sellers: "/orders/seller", - admin: "/orders/native", + admin: "/orders/native?status=Admin", completed: "/orders/native?status=Completed", cancelled: "/orders/native?status=Cancelled", pending: "/orders/native?status=Pending", @@ -204,7 +204,7 @@ export const Pages = { withdrawalRequests: "/sellers/withdrawal-requests", announcement: "/sellers/announcement", requestCreateProduct: "/sellers/request-create-product", - learningCategory: "/sellers/learning-category", + learningCategory: "/sellers/category", learning: "/sellers/learning", learningCreate: "/sellers/learning/create", learningUpdate: "/sellers/learning/update/", diff --git a/src/pages/Coupon/Create.tsx b/src/pages/Coupon/Create.tsx index dc3a4b6..c179074 100644 --- a/src/pages/Coupon/Create.tsx +++ b/src/pages/Coupon/Create.tsx @@ -214,6 +214,7 @@ const CreateCoupon: FC = () => { placeholder='انتخاب تاریخ' onChange={(date) => formik.setFieldValue('expirationDate', date)} error_text={formik.touched.expirationDate && formik.errors.expirationDate ? formik.errors.expirationDate : ''} + minDate={new Date()} />