From eee88e748240d7a9c081877e7edc8e9d4225d298 Mon Sep 17 00:00:00 2001 From: karimalden Date: Sun, 9 Jun 2024 16:50:07 +0300 Subject: [PATCH] first_push --- .gitignore | 24 + .vscode/settings.json | 11 + db.json | 76 +++ package.json | 104 ++++ public/Layout/LoginBg.jpg | Bin 0 -> 12765 bytes public/Logo.png | Bin 0 -> 1391 bytes public/Logo.svg | 11 + public/Logo_2.png | Bin 0 -> 2962 bytes public/index.html | 17 + public/language/ar.svg | 1 + public/language/china.svg | 2 + public/language/de.svg | 1 + public/language/en.svg | 1 + public/manifest.json | 25 + public/robots.txt | 3 + src/App.tsx | 69 +++ src/Components/Columns/ColumnsImage.tsx | 86 +++ src/Components/Columns/ColumnsSwitch.tsx | 42 ++ src/Components/Ui/Alert.tsx | 50 ++ src/Components/Ui/CheckboxesVuexy.tsx | 49 ++ src/Components/Ui/FileInput.tsx | 27 + src/Components/Ui/HovarableImage.tsx | 37 ++ src/Components/Ui/ImagePreview.tsx | 34 ++ src/Components/Ui/LoadingButton.tsx | 13 + src/Components/Ui/LoadingSpinner.tsx | 10 + .../Ui/PasswordField/PasswordField.tsx | 57 ++ src/Components/Ui/PasswordField/index.css | 10 + src/Components/Ui/ProgressBar.tsx | 24 + src/Components/Ui/SelectField.tsx | 29 + src/Components/Ui/StaticsCard/StaticCard.tsx | 58 ++ src/Components/Ui/StatusBadge.tsx | 17 + src/Components/Ui/TableActions.tsx | 38 ++ .../Ui/ThreeSwitchState/TripleSwitch.tsx | 31 + src/Components/Ui/ToggleStatus.tsx | 39 ++ src/Components/Ui/ValidatedField.tsx | 64 ++ src/Components/Ui/index.tsx | 17 + src/Components/Ui/tables/Actions.tsx | 58 ++ src/Components/Ui/tables/ConfirmAlert.tsx | 40 ++ src/Components/Ui/useImagePreview.tsx | 24 + src/Components/Utils/BlockModal.tsx | 62 ++ src/Components/Utils/GiftModal.tsx | 63 ++ src/Components/Utils/Loading/Loading.scss | 93 +++ src/Components/Utils/Loading/Loading.tsx | 19 + src/Components/Utils/SearchBar/SearchBar.scss | 43 ++ src/Components/Utils/SearchBar/SearchBar.tsx | 14 + src/Components/Utils/Theme.tsx | 84 +++ src/Components/Utils/Translate.tsx | 42 ++ src/Components/Utils/UnBlockModal.tsx | 60 ++ .../ValidationField/Ui/KarimSpinner.tsx | 18 + .../ValidationField/Ui/SearchBar.scss | 48 ++ .../ValidationField/Ui/SearchBar.tsx | 35 ++ .../ValidationField/ValidationField.scss | 78 +++ .../ValidationField/ValidationField.tsx | 34 ++ .../ValidationField/View/CheckboxField.tsx | 36 ++ .../ValidationField/View/DataRange.tsx | 44 ++ src/Components/ValidationField/View/Date.tsx | 51 ++ .../ValidationField/View/Default.tsx | 37 ++ src/Components/ValidationField/View/File.tsx | 64 ++ .../ValidationField/View/MaltyFile.tsx | 92 +++ .../ValidationField/View/SearchField.tsx | 69 +++ .../ValidationField/View/SelectField.tsx | 41 ++ .../ValidationField/View/TextArea.tsx | 45 ++ src/Components/ValidationField/View/Time.tsx | 41 ++ src/Components/ValidationField/View/index.tsx | 22 + src/Components/ValidationField/index.tsx | 21 + src/Components/ValidationField/types.ts | 132 +++++ src/Components/order/OrderStatus.tsx | 10 + src/Extensions/Editor/HtmlEditor.tsx | 42 ++ src/Extensions/Editor/SingleLangEditor.tsx | 43 ++ src/Extensions/Editor/StatusCard.tsx | 23 + .../FileGenerator/generateAddModal.js | 65 +++ src/Extensions/FileGenerator/generateApi.js | 40 ++ .../FileGenerator/generateColumn.js | 63 ++ .../FileGenerator/generateDashboard.js | 30 + .../FileGenerator/generateEditModal.js | 47 ++ src/Extensions/FileGenerator/generateForm.js | 66 +++ src/Extensions/FileGenerator/generateModel.js | 64 ++ src/Extensions/FileGenerator/generatePage.js | 67 +++ .../FileGenerator/generateformUtils.js | 73 +++ src/Hooks/WithDrawer.tsx | 45 ++ src/Hooks/imageUrlToFile.tsx | 13 + src/Hooks/isEmpty.tsx | 3 + src/Hooks/useChangeLanguage.tsx | 75 +++ src/Hooks/useEventListener.tsx | 16 + src/Hooks/useFormField.tsx | 16 + src/Hooks/useFormatToSelect.tsx | 16 + src/Hooks/useImageError.tsx | 9 + src/Hooks/useLoadingState.tsx | 21 + src/Hooks/useNavigateOnSuccess.ts | 20 + src/Hooks/usePagination.tsx | 38 ++ src/Hooks/useWindowSize.tsx | 18 + src/Layout/Dashboard/AddButton/AddButton.tsx | 33 ++ .../Dashboard/AddButton/AddButtonLayout.tsx | 41 ++ .../Dashboard/AddButton/Add_Button.scss | 77 +++ src/Layout/Dashboard/DashBody.tsx | 32 + src/Layout/Dashboard/DashHeader.tsx | 27 + src/Layout/Dashboard/FormPage.tsx | 42 ++ src/Layout/Dashboard/FormikForm.tsx | 67 +++ src/Layout/Dashboard/LayoutModal.tsx | 77 +++ src/Layout/Dashboard/LyTable.tsx | 39 ++ src/Layout/Dashboard/PageStructure.tsx | 36 ++ src/Layout/Dashboard/SearchField.tsx | 56 ++ src/Layout/Dashboard/SelectField.tsx | 39 ++ src/Layout/Dashboard/SelectWSearchField.tsx | 52 ++ src/Layout/Dashboard/ViewPage.tsx | 88 +++ src/Layout/Dashboard/useCloseModal.ts | 18 + src/Layout/app/Const.tsx | 48 ++ src/Layout/app/ErrorPage.tsx | 45 ++ src/Layout/app/Etaxi.tsx | 41 ++ src/Layout/app/Export.tsx | 11 + src/Layout/app/Header.tsx | 65 +++ src/Layout/app/KarimLogo.tsx | 54 ++ src/Layout/app/Layout.tsx | 39 ++ src/Layout/app/LoadingPage.tsx | 13 + src/Layout/app/NotFoundPage.tsx | 17 + src/Layout/app/SideBar.tsx | 116 ++++ src/Layout/app/Types.tsx | 19 + src/Layout/app/WithDrawer.tsx | 53 ++ src/Pages/Auth/LoginForm.tsx | 83 +++ src/Pages/Auth/Page.tsx | 32 + src/Pages/Auth/formUtil.ts | 36 ++ src/Pages/Categories/Page.tsx | 56 ++ src/Pages/Categories/View/Add/AddForm.tsx | 35 ++ .../View/Add/AttributeTab/AttributeTabs.tsx | 72 +++ .../View/Add/AttributeTab/Field/File.tsx | 63 ++ .../View/Add/AttributeTab/Field/FormItem.tsx | 19 + .../View/Add/AttributeTab/Field/Select.tsx | 41 ++ .../View/Add/AttributeTab/TabsContainer.tsx | 145 +++++ .../Add/AttributeValueTab/AttributeTabs.tsx | 116 ++++ .../View/Add/AttributeValueTab/Field/File.tsx | 67 +++ .../Add/AttributeValueTab/Field/FormItem.tsx | 19 + .../View/Add/AttributeValueTab/Field/Hex.tsx | 18 + .../Add/AttributeValueTab/TabsContainer.tsx | 132 +++++ .../Categories/View/Add/fn/isvalidation.ts | 87 +++ src/Pages/Categories/View/AddPage.tsx | 254 ++++++++ src/Pages/Categories/View/Atteibute.tsx | 37 ++ src/Pages/Categories/View/EditPage.tsx | 535 +++++++++++++++++ src/Pages/Categories/formUtil.ts | 102 ++++ src/Pages/Categories/useTableColumns.tsx | 75 +++ src/Pages/Coupon/Page.tsx | 47 ++ src/Pages/Coupon/View/AddForm.tsx | 84 +++ src/Pages/Coupon/View/AddPage.tsx | 77 +++ src/Pages/Coupon/View/EditForm.tsx | 81 +++ src/Pages/Coupon/View/EditPage.tsx | 106 ++++ src/Pages/Coupon/formUtil.ts | 117 ++++ src/Pages/Coupon/useTableColumns.tsx | 83 +++ src/Pages/Home/Chart.tsx | 52 ++ src/Pages/Home/HomePage.tsx | 66 +++ src/Pages/Notifcation/Page.tsx | 46 ++ src/Pages/Notifcation/View/AddForm.tsx | 84 +++ src/Pages/Notifcation/View/AddPage.tsx | 86 +++ src/Pages/Notifcation/View/formUtil.ts | 72 +++ src/Pages/Notifcation/useTableColumns.tsx | 72 +++ src/Pages/Products/ProductsPage.tsx | 58 ++ src/Pages/Products/View/AddPage.tsx | 130 +++++ .../Products/View/Addfn/AddNewVariation.ts | 83 +++ src/Pages/Products/View/Addfn/isvalidation.ts | 27 + src/Pages/Products/View/BasicInfo.tsx | 73 +++ src/Pages/Products/View/EditPage.tsx | 460 +++++++++++++++ .../View/FormikTab/Field/Atteibute.tsx | 76 +++ .../Products/View/FormikTab/Field/File.tsx | 66 +++ .../View/FormikTab/Field/FileImage.tsx | 65 +++ .../Products/View/FormikTab/Field/Object.tsx | 85 +++ .../Products/View/FormikTab/FormItem.tsx | 19 + .../Products/View/FormikTab/TabsContainer.tsx | 161 +++++ .../Products/View/FormikTab/VariableTabs.tsx | 99 ++++ src/Pages/Products/formUtil.ts | 128 ++++ src/Pages/Products/useTableColumns.tsx | 89 +++ src/Pages/Slider/Page.tsx | 47 ++ src/Pages/Slider/View/AddForm.tsx | 37 ++ src/Pages/Slider/View/AddPage.tsx | 65 +++ src/Pages/Slider/View/EditForm.tsx | 39 ++ src/Pages/Slider/View/EditPage.tsx | 89 +++ src/Pages/Slider/formUtil.ts | 67 +++ src/Pages/Slider/useTableColumns.tsx | 88 +++ src/Pages/SupportMessages/Page.tsx | 45 ++ src/Pages/SupportMessages/View/AddForm.tsx | 50 ++ src/Pages/SupportMessages/View/AddPage.tsx | 56 ++ src/Pages/SupportMessages/formUtil.ts | 46 ++ src/Pages/SupportMessages/useTableColumns.tsx | 62 ++ src/Pages/Users/Page.tsx | 56 ++ .../Users/SendNotifcation/View/AddForm.tsx | 43 ++ .../Users/SendNotifcation/View/AddPage.tsx | 79 +++ src/Pages/Users/SendNotifcation/formUtil.ts | 73 +++ src/Pages/Users/View/EditForm.tsx | 30 + src/Pages/Users/View/EditPage.tsx | 67 +++ src/Pages/Users/formUtil.ts | 52 ++ src/Pages/Users/ui/AddButtonNotification.tsx | 27 + src/Pages/Users/useTableColumns.tsx | 110 ++++ src/Pages/order/Edit/EditForm.tsx | 46 ++ src/Pages/order/Edit/formUtil.ts | 47 ++ src/Pages/order/EditPage.tsx | 108 ++++ src/Pages/order/OrderPage.tsx | 126 ++++ src/Pages/order/Products/ProductsPage.tsx | 44 ++ src/Pages/order/Products/useTableColumns.tsx | 49 ++ src/Pages/order/View/ViewForm.tsx | 52 ++ src/Pages/order/ui/CustomDateRange.tsx | 33 ++ src/Pages/order/ui/CustomNumber.tsx | 36 ++ src/Pages/order/ui/CustomSearchField.tsx | 50 ++ src/Pages/order/ui/CustomSelectField.tsx | 43 ++ .../order/ui/CustomSelectWSearchField.tsx | 55 ++ src/Pages/order/useTableColumns.tsx | 112 ++++ src/ProviderContainer.tsx | 24 + src/Routes.tsx | 204 +++++++ src/Styles/AppStyle/App.scss | 93 +++ src/Styles/AppStyle/Import.scss | 22 + src/Styles/AppStyle/Mixing.scss | 21 + src/Styles/AppStyle/Varibils.scss | 36 ++ src/Styles/Auth/Auth.scss | 156 +++++ src/Styles/Home/Auth.scss | 16 + src/Styles/Layout/FillterSection.scss | 18 + src/Styles/Layout/Header.scss | 120 ++++ src/Styles/Layout/Layout.scss | 548 ++++++++++++++++++ src/Styles/Layout/SideBar.scss | 354 +++++++++++ src/Styles/Layout/Table.scss | 101 ++++ src/Styles/component/DarkStyle.scss | 115 ++++ src/Styles/component/DriverInfoSocket.scss | 102 ++++ src/Styles/component/ErrorPage.scss | 21 + src/Styles/component/Tab_Info.scss | 14 + src/Styles/component/printButton.scss | 16 + src/Styles/component/radio.scss | 79 +++ src/api/Categories.ts | 26 + src/api/Coupon.ts | 25 + src/api/Slider.ts | 25 + src/api/attribute.ts | 29 + src/api/attributeValue.ts | 31 + src/api/auth.ts | 11 + src/api/baseSubCategory.ts | 26 + src/api/config.ts | 19 + src/api/helper/AxiosBuilder.ts | 49 ++ src/api/helper/Get.tsx | 18 + src/api/helper/buildFormData.ts | 27 + src/api/helper/ueGetPagination.tsx | 44 ++ src/api/helper/useAddMutation.ts | 39 ++ src/api/helper/useAddMutationJson.ts | 35 ++ src/api/helper/useAxios.ts | 25 + src/api/helper/useDeleteMutation.ts | 35 ++ src/api/helper/useGetOneQuery.ts | 39 ++ src/api/helper/useGetQuery.ts | 41 ++ src/api/helper/useGetSingleQuery.ts | 38 ++ src/api/helper/useGetWithFillter.ts | 22 + src/api/helper/useToggleStatus.ts | 32 + src/api/helper/useUpdateMutation.ts | 58 ++ src/api/helper/useUpdateMutationById.ts | 57 ++ src/api/helper/useUpdateMutationPut.ts | 52 ++ src/api/helper/useUploadWithProgress.ts | 75 +++ src/api/home.ts | 14 + src/api/notification.ts | 23 + src/api/order.ts | 32 + src/api/product.ts | 38 ++ src/api/supportmessages.ts | 24 + src/api/users.ts | 32 + src/asset/logo/MainLogo.png | Bin 0 -> 17202 bytes src/config/AppKey.ts | 12 + src/config/QueryStatus.ts | 8 + src/config/RoleConfige.ts | 7 + src/enums/ChartTypeEnum.ts | 14 + src/enums/SocketEventEnum.ts | 15 + src/index.tsx | 14 + src/lib/ReactQueryProvider.tsx | 17 + src/lib/SocketProvider.tsx | 37 ++ src/lib/ToastProvider.tsx | 27 + src/lib/state mangment/AuthState.ts | 51 ++ src/lib/state mangment/LayoutPagestate.ts | 29 + src/lib/state mangment/Pages/Products.ts | 15 + .../driver&customer/ModelState.tsx | 33 ++ src/translate/ar.json | 191 ++++++ src/translate/cn.json | 190 ++++++ src/translate/en.json | 191 ++++++ src/translate/text | 11 + src/types/SocketEvent.ts | 8 + src/types/User.ts | 21 + src/utils/Array/ArrayToObjectFormik.ts | 26 + src/utils/Array/changeShapeInfo.tsx | 14 + src/utils/Array/filterUndefinedAndEmpty.ts | 5 + src/utils/Array/getInfoKeyAndDescriptions.ts | 12 + src/utils/Date/ChangeFormat.ts | 5 + src/utils/colors/getPrimaryColor.ts | 3 + .../language/mapTranslatedProperties.tsx | 27 + src/zustand/Modal.ts | 15 + src/zustand/OrderFillter.ts | 50 ++ tsconfig.json | 26 + 282 files changed, 15675 insertions(+) create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 db.json create mode 100644 package.json create mode 100644 public/Layout/LoginBg.jpg create mode 100644 public/Logo.png create mode 100644 public/Logo.svg create mode 100644 public/Logo_2.png create mode 100644 public/index.html create mode 100644 public/language/ar.svg create mode 100644 public/language/china.svg create mode 100644 public/language/de.svg create mode 100644 public/language/en.svg create mode 100644 public/manifest.json create mode 100644 public/robots.txt create mode 100644 src/App.tsx create mode 100644 src/Components/Columns/ColumnsImage.tsx create mode 100644 src/Components/Columns/ColumnsSwitch.tsx create mode 100644 src/Components/Ui/Alert.tsx create mode 100644 src/Components/Ui/CheckboxesVuexy.tsx create mode 100644 src/Components/Ui/FileInput.tsx create mode 100644 src/Components/Ui/HovarableImage.tsx create mode 100644 src/Components/Ui/ImagePreview.tsx create mode 100644 src/Components/Ui/LoadingButton.tsx create mode 100644 src/Components/Ui/LoadingSpinner.tsx create mode 100644 src/Components/Ui/PasswordField/PasswordField.tsx create mode 100644 src/Components/Ui/PasswordField/index.css create mode 100644 src/Components/Ui/ProgressBar.tsx create mode 100644 src/Components/Ui/SelectField.tsx create mode 100644 src/Components/Ui/StaticsCard/StaticCard.tsx create mode 100644 src/Components/Ui/StatusBadge.tsx create mode 100644 src/Components/Ui/TableActions.tsx create mode 100644 src/Components/Ui/ThreeSwitchState/TripleSwitch.tsx create mode 100644 src/Components/Ui/ToggleStatus.tsx create mode 100644 src/Components/Ui/ValidatedField.tsx create mode 100644 src/Components/Ui/index.tsx create mode 100644 src/Components/Ui/tables/Actions.tsx create mode 100644 src/Components/Ui/tables/ConfirmAlert.tsx create mode 100644 src/Components/Ui/useImagePreview.tsx create mode 100644 src/Components/Utils/BlockModal.tsx create mode 100644 src/Components/Utils/GiftModal.tsx create mode 100644 src/Components/Utils/Loading/Loading.scss create mode 100644 src/Components/Utils/Loading/Loading.tsx create mode 100644 src/Components/Utils/SearchBar/SearchBar.scss create mode 100644 src/Components/Utils/SearchBar/SearchBar.tsx create mode 100644 src/Components/Utils/Theme.tsx create mode 100644 src/Components/Utils/Translate.tsx create mode 100644 src/Components/Utils/UnBlockModal.tsx create mode 100644 src/Components/ValidationField/Ui/KarimSpinner.tsx create mode 100644 src/Components/ValidationField/Ui/SearchBar.scss create mode 100644 src/Components/ValidationField/Ui/SearchBar.tsx create mode 100644 src/Components/ValidationField/ValidationField.scss create mode 100644 src/Components/ValidationField/ValidationField.tsx create mode 100644 src/Components/ValidationField/View/CheckboxField.tsx create mode 100644 src/Components/ValidationField/View/DataRange.tsx create mode 100644 src/Components/ValidationField/View/Date.tsx create mode 100644 src/Components/ValidationField/View/Default.tsx create mode 100644 src/Components/ValidationField/View/File.tsx create mode 100644 src/Components/ValidationField/View/MaltyFile.tsx create mode 100644 src/Components/ValidationField/View/SearchField.tsx create mode 100644 src/Components/ValidationField/View/SelectField.tsx create mode 100644 src/Components/ValidationField/View/TextArea.tsx create mode 100644 src/Components/ValidationField/View/Time.tsx create mode 100644 src/Components/ValidationField/View/index.tsx create mode 100644 src/Components/ValidationField/index.tsx create mode 100644 src/Components/ValidationField/types.ts create mode 100644 src/Components/order/OrderStatus.tsx create mode 100644 src/Extensions/Editor/HtmlEditor.tsx create mode 100644 src/Extensions/Editor/SingleLangEditor.tsx create mode 100644 src/Extensions/Editor/StatusCard.tsx create mode 100644 src/Extensions/FileGenerator/generateAddModal.js create mode 100644 src/Extensions/FileGenerator/generateApi.js create mode 100644 src/Extensions/FileGenerator/generateColumn.js create mode 100644 src/Extensions/FileGenerator/generateDashboard.js create mode 100644 src/Extensions/FileGenerator/generateEditModal.js create mode 100644 src/Extensions/FileGenerator/generateForm.js create mode 100644 src/Extensions/FileGenerator/generateModel.js create mode 100644 src/Extensions/FileGenerator/generatePage.js create mode 100644 src/Extensions/FileGenerator/generateformUtils.js create mode 100644 src/Hooks/WithDrawer.tsx create mode 100644 src/Hooks/imageUrlToFile.tsx create mode 100644 src/Hooks/isEmpty.tsx create mode 100644 src/Hooks/useChangeLanguage.tsx create mode 100644 src/Hooks/useEventListener.tsx create mode 100644 src/Hooks/useFormField.tsx create mode 100644 src/Hooks/useFormatToSelect.tsx create mode 100644 src/Hooks/useImageError.tsx create mode 100644 src/Hooks/useLoadingState.tsx create mode 100644 src/Hooks/useNavigateOnSuccess.ts create mode 100644 src/Hooks/usePagination.tsx create mode 100644 src/Hooks/useWindowSize.tsx create mode 100644 src/Layout/Dashboard/AddButton/AddButton.tsx create mode 100644 src/Layout/Dashboard/AddButton/AddButtonLayout.tsx create mode 100644 src/Layout/Dashboard/AddButton/Add_Button.scss create mode 100644 src/Layout/Dashboard/DashBody.tsx create mode 100644 src/Layout/Dashboard/DashHeader.tsx create mode 100644 src/Layout/Dashboard/FormPage.tsx create mode 100644 src/Layout/Dashboard/FormikForm.tsx create mode 100644 src/Layout/Dashboard/LayoutModal.tsx create mode 100644 src/Layout/Dashboard/LyTable.tsx create mode 100644 src/Layout/Dashboard/PageStructure.tsx create mode 100644 src/Layout/Dashboard/SearchField.tsx create mode 100644 src/Layout/Dashboard/SelectField.tsx create mode 100644 src/Layout/Dashboard/SelectWSearchField.tsx create mode 100644 src/Layout/Dashboard/ViewPage.tsx create mode 100644 src/Layout/Dashboard/useCloseModal.ts create mode 100644 src/Layout/app/Const.tsx create mode 100644 src/Layout/app/ErrorPage.tsx create mode 100644 src/Layout/app/Etaxi.tsx create mode 100644 src/Layout/app/Export.tsx create mode 100644 src/Layout/app/Header.tsx create mode 100644 src/Layout/app/KarimLogo.tsx create mode 100644 src/Layout/app/Layout.tsx create mode 100644 src/Layout/app/LoadingPage.tsx create mode 100644 src/Layout/app/NotFoundPage.tsx create mode 100644 src/Layout/app/SideBar.tsx create mode 100644 src/Layout/app/Types.tsx create mode 100644 src/Layout/app/WithDrawer.tsx create mode 100644 src/Pages/Auth/LoginForm.tsx create mode 100644 src/Pages/Auth/Page.tsx create mode 100644 src/Pages/Auth/formUtil.ts create mode 100644 src/Pages/Categories/Page.tsx create mode 100644 src/Pages/Categories/View/Add/AddForm.tsx create mode 100644 src/Pages/Categories/View/Add/AttributeTab/AttributeTabs.tsx create mode 100644 src/Pages/Categories/View/Add/AttributeTab/Field/File.tsx create mode 100644 src/Pages/Categories/View/Add/AttributeTab/Field/FormItem.tsx create mode 100644 src/Pages/Categories/View/Add/AttributeTab/Field/Select.tsx create mode 100644 src/Pages/Categories/View/Add/AttributeTab/TabsContainer.tsx create mode 100644 src/Pages/Categories/View/Add/AttributeValueTab/AttributeTabs.tsx create mode 100644 src/Pages/Categories/View/Add/AttributeValueTab/Field/File.tsx create mode 100644 src/Pages/Categories/View/Add/AttributeValueTab/Field/FormItem.tsx create mode 100644 src/Pages/Categories/View/Add/AttributeValueTab/Field/Hex.tsx create mode 100644 src/Pages/Categories/View/Add/AttributeValueTab/TabsContainer.tsx create mode 100644 src/Pages/Categories/View/Add/fn/isvalidation.ts create mode 100644 src/Pages/Categories/View/AddPage.tsx create mode 100644 src/Pages/Categories/View/Atteibute.tsx create mode 100644 src/Pages/Categories/View/EditPage.tsx create mode 100644 src/Pages/Categories/formUtil.ts create mode 100644 src/Pages/Categories/useTableColumns.tsx create mode 100644 src/Pages/Coupon/Page.tsx create mode 100644 src/Pages/Coupon/View/AddForm.tsx create mode 100644 src/Pages/Coupon/View/AddPage.tsx create mode 100644 src/Pages/Coupon/View/EditForm.tsx create mode 100644 src/Pages/Coupon/View/EditPage.tsx create mode 100644 src/Pages/Coupon/formUtil.ts create mode 100644 src/Pages/Coupon/useTableColumns.tsx create mode 100644 src/Pages/Home/Chart.tsx create mode 100644 src/Pages/Home/HomePage.tsx create mode 100644 src/Pages/Notifcation/Page.tsx create mode 100644 src/Pages/Notifcation/View/AddForm.tsx create mode 100644 src/Pages/Notifcation/View/AddPage.tsx create mode 100644 src/Pages/Notifcation/View/formUtil.ts create mode 100644 src/Pages/Notifcation/useTableColumns.tsx create mode 100644 src/Pages/Products/ProductsPage.tsx create mode 100644 src/Pages/Products/View/AddPage.tsx create mode 100644 src/Pages/Products/View/Addfn/AddNewVariation.ts create mode 100644 src/Pages/Products/View/Addfn/isvalidation.ts create mode 100644 src/Pages/Products/View/BasicInfo.tsx create mode 100644 src/Pages/Products/View/EditPage.tsx create mode 100644 src/Pages/Products/View/FormikTab/Field/Atteibute.tsx create mode 100644 src/Pages/Products/View/FormikTab/Field/File.tsx create mode 100644 src/Pages/Products/View/FormikTab/Field/FileImage.tsx create mode 100644 src/Pages/Products/View/FormikTab/Field/Object.tsx create mode 100644 src/Pages/Products/View/FormikTab/FormItem.tsx create mode 100644 src/Pages/Products/View/FormikTab/TabsContainer.tsx create mode 100644 src/Pages/Products/View/FormikTab/VariableTabs.tsx create mode 100644 src/Pages/Products/formUtil.ts create mode 100644 src/Pages/Products/useTableColumns.tsx create mode 100644 src/Pages/Slider/Page.tsx create mode 100644 src/Pages/Slider/View/AddForm.tsx create mode 100644 src/Pages/Slider/View/AddPage.tsx create mode 100644 src/Pages/Slider/View/EditForm.tsx create mode 100644 src/Pages/Slider/View/EditPage.tsx create mode 100644 src/Pages/Slider/formUtil.ts create mode 100644 src/Pages/Slider/useTableColumns.tsx create mode 100644 src/Pages/SupportMessages/Page.tsx create mode 100644 src/Pages/SupportMessages/View/AddForm.tsx create mode 100644 src/Pages/SupportMessages/View/AddPage.tsx create mode 100644 src/Pages/SupportMessages/formUtil.ts create mode 100644 src/Pages/SupportMessages/useTableColumns.tsx create mode 100644 src/Pages/Users/Page.tsx create mode 100644 src/Pages/Users/SendNotifcation/View/AddForm.tsx create mode 100644 src/Pages/Users/SendNotifcation/View/AddPage.tsx create mode 100644 src/Pages/Users/SendNotifcation/formUtil.ts create mode 100644 src/Pages/Users/View/EditForm.tsx create mode 100644 src/Pages/Users/View/EditPage.tsx create mode 100644 src/Pages/Users/formUtil.ts create mode 100644 src/Pages/Users/ui/AddButtonNotification.tsx create mode 100644 src/Pages/Users/useTableColumns.tsx create mode 100644 src/Pages/order/Edit/EditForm.tsx create mode 100644 src/Pages/order/Edit/formUtil.ts create mode 100644 src/Pages/order/EditPage.tsx create mode 100644 src/Pages/order/OrderPage.tsx create mode 100644 src/Pages/order/Products/ProductsPage.tsx create mode 100644 src/Pages/order/Products/useTableColumns.tsx create mode 100644 src/Pages/order/View/ViewForm.tsx create mode 100644 src/Pages/order/ui/CustomDateRange.tsx create mode 100644 src/Pages/order/ui/CustomNumber.tsx create mode 100644 src/Pages/order/ui/CustomSearchField.tsx create mode 100644 src/Pages/order/ui/CustomSelectField.tsx create mode 100644 src/Pages/order/ui/CustomSelectWSearchField.tsx create mode 100644 src/Pages/order/useTableColumns.tsx create mode 100644 src/ProviderContainer.tsx create mode 100644 src/Routes.tsx create mode 100644 src/Styles/AppStyle/App.scss create mode 100644 src/Styles/AppStyle/Import.scss create mode 100644 src/Styles/AppStyle/Mixing.scss create mode 100644 src/Styles/AppStyle/Varibils.scss create mode 100644 src/Styles/Auth/Auth.scss create mode 100644 src/Styles/Home/Auth.scss create mode 100644 src/Styles/Layout/FillterSection.scss create mode 100644 src/Styles/Layout/Header.scss create mode 100644 src/Styles/Layout/Layout.scss create mode 100644 src/Styles/Layout/SideBar.scss create mode 100644 src/Styles/Layout/Table.scss create mode 100644 src/Styles/component/DarkStyle.scss create mode 100644 src/Styles/component/DriverInfoSocket.scss create mode 100644 src/Styles/component/ErrorPage.scss create mode 100644 src/Styles/component/Tab_Info.scss create mode 100644 src/Styles/component/printButton.scss create mode 100644 src/Styles/component/radio.scss create mode 100644 src/api/Categories.ts create mode 100644 src/api/Coupon.ts create mode 100644 src/api/Slider.ts create mode 100644 src/api/attribute.ts create mode 100644 src/api/attributeValue.ts create mode 100644 src/api/auth.ts create mode 100644 src/api/baseSubCategory.ts create mode 100644 src/api/config.ts create mode 100644 src/api/helper/AxiosBuilder.ts create mode 100644 src/api/helper/Get.tsx create mode 100644 src/api/helper/buildFormData.ts create mode 100644 src/api/helper/ueGetPagination.tsx create mode 100644 src/api/helper/useAddMutation.ts create mode 100644 src/api/helper/useAddMutationJson.ts create mode 100644 src/api/helper/useAxios.ts create mode 100644 src/api/helper/useDeleteMutation.ts create mode 100644 src/api/helper/useGetOneQuery.ts create mode 100644 src/api/helper/useGetQuery.ts create mode 100644 src/api/helper/useGetSingleQuery.ts create mode 100644 src/api/helper/useGetWithFillter.ts create mode 100644 src/api/helper/useToggleStatus.ts create mode 100644 src/api/helper/useUpdateMutation.ts create mode 100644 src/api/helper/useUpdateMutationById.ts create mode 100644 src/api/helper/useUpdateMutationPut.ts create mode 100644 src/api/helper/useUploadWithProgress.ts create mode 100644 src/api/home.ts create mode 100644 src/api/notification.ts create mode 100644 src/api/order.ts create mode 100644 src/api/product.ts create mode 100644 src/api/supportmessages.ts create mode 100644 src/api/users.ts create mode 100644 src/asset/logo/MainLogo.png create mode 100644 src/config/AppKey.ts create mode 100644 src/config/QueryStatus.ts create mode 100644 src/config/RoleConfige.ts create mode 100644 src/enums/ChartTypeEnum.ts create mode 100644 src/enums/SocketEventEnum.ts create mode 100644 src/index.tsx create mode 100644 src/lib/ReactQueryProvider.tsx create mode 100644 src/lib/SocketProvider.tsx create mode 100644 src/lib/ToastProvider.tsx create mode 100644 src/lib/state mangment/AuthState.ts create mode 100644 src/lib/state mangment/LayoutPagestate.ts create mode 100644 src/lib/state mangment/Pages/Products.ts create mode 100644 src/lib/state mangment/driver&customer/ModelState.tsx create mode 100644 src/translate/ar.json create mode 100644 src/translate/cn.json create mode 100644 src/translate/en.json create mode 100644 src/translate/text create mode 100644 src/types/SocketEvent.ts create mode 100644 src/types/User.ts create mode 100644 src/utils/Array/ArrayToObjectFormik.ts create mode 100644 src/utils/Array/changeShapeInfo.tsx create mode 100644 src/utils/Array/filterUndefinedAndEmpty.ts create mode 100644 src/utils/Array/getInfoKeyAndDescriptions.ts create mode 100644 src/utils/Date/ChangeFormat.ts create mode 100644 src/utils/colors/getPrimaryColor.ts create mode 100644 src/utils/language/mapTranslatedProperties.tsx create mode 100644 src/zustand/Modal.ts create mode 100644 src/zustand/OrderFillter.ts create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..894437f --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local +pnpm-lock.ymal +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-lock.yaml diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6a521b2 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "cSpell.words": [ + "aldeen", + "Datepicker", + "formik", + "Karim", + "queryqlent", + "szhsin", + "Viewelement" + ] +} \ No newline at end of file diff --git a/db.json b/db.json new file mode 100644 index 0000000..7d19fac --- /dev/null +++ b/db.json @@ -0,0 +1,76 @@ +{ + "example": [ + { + "id": 1, + "name": "ibrahim", + "email": "ibrahim@gmail.com" + }, + { + "id": 2, + "name": "gregr", + "email": "ibrahimgmail.com" + }, + { + "id": 3, + "name": "mhmad", + "email": "mhmad@gmial.com" + }, + { + "id": 4, + "name": "soso", + "email": "soso@gmail.com" + }, + { + "id": 5, + "name": "few", + "email": "jfpwrej" + }, + { + "id": 6, + "name": "sos", + "email": "fdwf" + }, + { + "id": 7, + "name": "sos", + "email": "fdwf" + }, + { + "id": 8, + "name": "sos", + "email": "fdwf" + } + ], + "test2":[ + + + { + "id":1, + "email":"admin@adamin.com" + } + , + { + "id":1, + "email":"admin@adamin.com" + } + , + { + "id":1, + "email":"admin@adamin.com" + } + + , { + "id":1, + "email":"admin@adamin.com" + } + + ], + "users": [ + { + "id": 1, + "email": "admin@adamin.com", + "password": "password", + "token": "token" + } + ] +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..6084c26 --- /dev/null +++ b/package.json @@ -0,0 +1,104 @@ +{ + "name": "my-app", + "version": "0.1.0", + "private": true, + "dependencies": { + "@ant-design/icons": "^4.8.3", + "@emotion/styled": "^11.11.0", + "@mui/icons-material": "^5.14.19", + "@mui/x-charts": "^6.19.4", + "@react-google-maps/api": "^2.19.2", + "@szhsin/react-menu": "github:szhsin/react-menu", + "@testing-library/jest-dom": "^5.17.0", + "@testing-library/react": "^13.4.0", + "@testing-library/user-event": "^13.5.0", + "@tinymce/tinymce-react": "^4.3.2", + "@types/jest": "^27.5.2", + "@types/node": "^16.18.60", + "@types/react": "^18.2.33", + "@types/react-dom": "^18.2.14", + "@types/socket.io-client": "^3.0.0", + "@wojtekmaj/react-daterange-picker": "^5.4.4", + "antd": "^5.12.1", + "apexcharts": "^3.44.2", + "axios": "^1.6.0", + "bootstrap": "^5.3.2", + "chart.js": "^4.4.0", + "dayjs": "^1.11.10", + "formik": "^2.4.5", + "history": "^5.3.0", + "i18next": "^23.6.0", + "i18next-browser-languagedetector": "^7.1.0", + "json-server": "^0.17.4", + "moment": "^2.30.1", + "prop-types": "^15.8.1", + "react": "^18.2.0", + "react-apexcharts": "^1.4.1", + "react-bootstrap": "^2.9.1", + "react-bootstrap-sweetalert": "^5.2.0", + "react-chartjs-2": "^5.2.0", + "react-confirm-alert": "^3.0.6", + "react-data-table-component": "^7.5.4", + "react-dom": "^18.2.0", + "react-feather": "^2.0.10", + "react-i18next": "^13.3.1", + "react-icons": "^4.11.0", + "react-input-range": "^1.3.0", + "react-number-format": "^5.3.4", + "react-query": "^3.39.3", + "react-redux": "^8.1.3", + "react-router-dom": "^6.18.0", + "react-scripts": "5.0.1", + "react-select": "^5.7.7", + "react-simple-star-rating": "^5.1.7", + "react-switch": "^7.0.0", + "react-tabs": "^6.0.2", + "react-toastify": "^9.1.3", + "react-toggle": "^4.1.3", + "reactstrap": "^9.2.0", + "redux": "^4.2.1", + "sass": "^1.69.5", + "socket.io-client": "^4.7.2", + "styled-components": "5.3.3", + "ts-xlsx": "^0.0.11", + "typescript": "^4.9.5", + "web-vitals": "^2.1.4", + "xlsx": "^0.18.5", + "yup": "^1.3.2", + "zustand": "^4.4.5" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject", + "g:api": "node src/Extensions/FileGenerator/generateApi.js", + "g:column": "node src/Extensions/FileGenerator/generateColumn.js", + "g:formutil": "node src/Extensions/FileGenerator/generateformUtils.js", + "g:page": "node src/Extensions/FileGenerator/generatePage.js", + "g:dashboard": "node src/Extensions/FileGenerator/generateDashboard.js ", + "g:modal:add": "node src/Extensions/FileGenerator/generateEditModal.js ", + "g:model:edit": "node src/Extensions/FileGenerator/generateEditModal.js " + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "@types/react-toggle": "^4.0.5" + } +} diff --git a/public/Layout/LoginBg.jpg b/public/Layout/LoginBg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fc3a090c728c93aed2fee052b5aec317d0b9a027 GIT binary patch literal 12765 zcmeHO3se(V8oo0Vk^muw7!gEJDlY*MqR2zVfCBPZP*ID58o&qQ7DS4V?Xr!auB$?| zqT(YO!3P3cWNR%H>qZn5LDxsIBGgAkte|VfuIt*?bdo>_nLEiOvS-hpljI!c-tYha z@BZ`6fA5_ngY35KKHx-zhKB+K0RX|@K-LPT0v6NM+?2^OH#28ju-IIC9@o;6>ts9J z%HG4p)6?C>-ObxKbfWk8;PGzmlVbyer$~H(^dxeCY3@BjqHB1)I&~a2`d$c%(HOXCsHOowB@~n00W1sw zCxClU|<*z^<#sskFfh3LSR5;5#*1QFDMn8itm z9@t4DMw|2#5!8WHN?;C8i6D}jM+CJa79mhOO!QU$*Pya2_b? z1HYOIUx+S$HWNWMt&$XWgNfz|$6FUT5IQOZp z=-5nMq|pZosNW6W^D^g zkCR5~o7j|Pf$jRLk$W2bR7b7-KNV?uko3`g6g<@z7|fYPIdfnkB^g!?RXCkJWT2Ul48Qm02*Q=R?tNDB3$wo^Ooq`OkcM&;6`YLPco<+zEx zSVHbbwCG$I zO!ro*NaX2MI_sLErPm*Nk%)pn7RIM^iW*dumM_3Egc?wqq(G0gwl8-o8!7HhdF$+B z27sd8dQN-g2>)}r5ko2v0PVN_%5y_GdM;KyqEnfg8%or#5cM{N6>C!pb-I3@zWsWz zPJ=59rGn|Y2}Mi|nvsg3D<#@9m^xm&U7OWbq|It*g(x|-FDHgph>}}t4f6HhZq!vE z`D#ev63i8;yXxIGOC=5A>>@Q$Gmx*b^l$++3UV*9$>ZQg9z)eaQsB%85mg3qKllQU zIZDVwC|j_V5Z8CUj7m<}JuT-7WIO{P6CXm*08~g1Ct*byhzjZ9)|{Elr6R(a7z$|2 zo`I>5-eg9rZ-+D|K`%ZaN434jz`F(VG}JzyEH>A~t3;6?ZC0brsDM!cqXI?+j0zYPFe+eFz^H&xf&W_tEJ7Q3M@RA_8n*m5PQf;R z#|`=Sjx_ItF8zM@qLj_(8v*++DLm2PWxKaiiqXT#$8J=4??)_$i_x?72&Lls#BS6P zl^<)lbb!7A>7nFx+3~Nb=mF=!@qoVGySGvUE>4%I(J(Chd!m7I2b`D7_h~?eb_2rVh`&zOA0+?sRj+~K zp4dU2#TlrpOD`_Z5)t#EO{x(PQN0ny^v?8=kSHwwKneub6Ee3ObqZSIn9Clao?JwC zi;L5{h^QPvI&NxK6Wmb?ij{xpyB%&vE?2#)I41d(w_M@u02$;gB{5Nj|8P=m9n%PU zq5dF_x@{2tptB1Hpa>0roAf>hji3Ot6t48_vZu1g_R~z!$)(NnYww-8jS3SUwVwFP6;w*kno~Yz@5X;vZ=}_xg*SoqnVor= ziPA=?XxYE)YtMV4h{W!zX^%bdKT8^N`x;H`yCagRhP&cdROaaR7qVWw>! z9&v4tMDao6TL1P)5--?o-n3@S4@>aY7cm{&82{95GO)QBd_T^r{gHH8T~2r62~(Gy zg{&9iu&QS3H%$f0-ba0A_&v92srE0t8fnsAUy|tfa^GiZSBu-0C3pGSoEVuoO!7a^%p)%*Ds&OTF3UBtJQ*2xQ3bqhLtf?jWHYCG`js#{qLqf$3&xL-VY5S0o7n73`_s-dh0Uf9PdSR&d))&*$q?snNysY=uB#64UX%0Oy*-ifcFo|j%(lk8nVw6Us%7Bs!$;Zk&V_uV1Tqkew1*x!=3_N{%?8Ua zfy?@}1>ryE6}?x1Js4tfDKG3lUMFIcCe#-DqE4K^hiieI==BA<)q6g+YZjCi?EQM$ zk+SXB%kb6V1@Ij{ccGe3Lsw|U!2Z8v4Er%6VNm|j zVXeq$?+z!QMSlt`%BrZWm=n2jY)?qT+(_Ge_E(CK;)6c|zwT{^3v!v2BfAp0TkSu> z6YOxWSb69A>@U$5t}+mcpY^1h6|;7f@7_OtzMKDZhPd=}=JWSKRD{R6XWV_CAq&#> z{F+)fH;ooC<@%PxYptY(3z*FXZ_ni%jF$g5!bnT}KMPP4F;PuXORy4|A=)nR5=u^9 zQ%pe=!KdJzEf;A^uSRc1Wrw@ ztckC_emeGeU4Ca}lJ5%JFIv8@N&7Z)OLL9*mD|5>`;{#W_!u9VhmYLm|M z{o#J(&ZHes4QkGg{dhIlQ~ysj11xCI-asu7=Y|g2`;P=E*Ww*FO;#0C$N7HkGHqdA zyntUfwIbho0Bl1yo36j@Lhfs<5V)2N4S)zg#Tr`lvcRw!tVk5waBBB*XHY+``?1@M zYlY7T@*e*yt03$Z8n}TK6||lJ2tCMs1-}Ej&>$o%BkuKIx5Us5tVomy7kH36%V>1l zm}`ZY{^b1NMILzsWl+J2e9cpCO%|VK&$Di{rCg}^a0r#LnD7b33s54GEQ0nCqA&dH zutQwWsQ5z&C9txhe&G=4 zP>>+sda67F@n!a-8v-BeecqLCL^MDLre6iNNzgq)r4!ZA%W5oT>zjh!?e}?0s%b4G z4}bns8wz{@+7X|jI&3_?{}OFz)BF8@nI=o~Vh+F94b*`a9cbdun4dMxbq{V=7KpDO zyu1mR90U2p>%ja&V(G`?VYEqT$x&EfEjf`7iJBvxzOWt`X~(znmA)~3A?501m_MBx zHWq`D@Z*neGbD~-zB}a8XPQ4rU`3htOxA;V#jEu|j~|l_TO){HP%jW$G{!TJT@0@D z{nA$CTMvOwUrji+4Dl7$nRFYV4ugc|+8#k7y*n|G(o+gjAMcbEC6mhz^bDcGTfYbC z>rA^}d(q475u}YjFkKbM{2+{LX^@Sb)A+T)y@XsB#g_Pwwr}E)*a|_$_yZKr_Lros z@-a?Uu23K;4P0yeED!XEMUf=dU_DaCW7=ZZ13kLYIMg^n1*(V4 z$ihptnT~vw#F~@RNm4iY2LZQ(4v~sOqXdP@_Ri34l3AcP9r?g zD-MkjT!xdg!{rHDg$Ujyb2(9T`v@f^7B5XwNvu|CS+0dDZ6A&rIF;b+tO2uXuJ xuxMR!U0Hp5BSjQ)5lmhcb* + + + + + + + + + + diff --git a/public/Logo_2.png b/public/Logo_2.png new file mode 100644 index 0000000000000000000000000000000000000000..bdd8276e6302c954820a5b1cc7c4b09663114af3 GIT binary patch literal 2962 zcmV;D3vKj?P)c)QXYc<=Amo8U5)vK}K~YguMn?nVyg^EyJd+TT{Qtds`rW)51ZrT~Wa;qD+_`u6p55I0?e4c{ z&)z>wX8<<+JUb#X#(TR*@x3B^8IeRXtAm>43u0Okv}x6O)6>f63ZXvKHu<@8Moke0-g8nH@ye&FR>LHIvfW-I2} z#>z{k2%uACAcs-7Gbbp*~0K zia}&3j3YmEs61UUr7Rg9d-H24@yXuKU870U9iVdc_if?z^qqah02b0aoAR_!xCqrX zrBPR};-_*m$UqoJKA42AS8cjX|uK& zBAazzG_1^!wJ>W!;jv7pL?G-Y?s-EjqFnGnYeN;xG?D zh1lczow(kQ7P+`_F%!4fKH|Eq+sF_Yr}=N()ML}B*e|&$cD9a)nWeStchhyYT?679 zI~8wGit5)1XaGC0tF?y=g0YLNQ$gl+9ZS&jOWbR}$5-hF-rQ?P^d{2Wr@@Nzi^}b5 z$sia5=U2vbSs;`%Hjuv|W83g0VFFRNpMW+FAJ$kC2 zVw>Ix(PzYZh&s5{Vy)1PE&h%Sf^p>65C``@@yB!MR3W;lOl*Bp@d2d|qz#F+eoh(+Xl<>XKqkp0yDj-I>*YrC} z$RHRw;cBfVFWPuNWHLu2qxlBE->Rv6n+$`Iz70iEz zM||~j0ra1D=hSsd{{XP zKE1n#y8_0SL0a}em9vfnb^-e$VdiRid~p#_pZ~&vmM6pX~npm>Mz|#*$z1RPL?N{W;V?aw{Q! zg@ZpGVa-8~L;acc>)lk^GDfJH41{sy2Lb_=9vUzW(SnKG5E^I%Hcx~*i%!;>%7jy{Sl!wMLM;~0p0BOpH~Uz`cOZPhvxxd0b-|F3d<(pB)E?rg{?v4d*RWz3#{`nHww4UCQQu2{TeRQ#+#FSGZ{XH~yWf-}RnP?mqet7d(vK{sPXqTGRb> za^kW0qUS_AW3T{7#Yp)r@-||N{ZVRXw7cwd^VGdiZ2MB63pavMER^IPoL_H;#v~cr;6fr$K)erb=T118?}S@w zdFOx`3#R{D$iju*Esy4%>&AWPEY9LA&f>p^j5Vcm#}|}eH#&Qh?}u#D*Ax$_|0eAO zNG=plM!~)b&9)!xyOInJTwLQ+^$D{g z5XoZ$RKWu=H z${H4TS4KhUE<`?FM0CwFpVVjg-DlUGNi6SlBhVH%YOiFSsGT@y8Ux53k(r ztLErl${U)3#!F^V)3FL3RsU53yjYa!2~P>pOxdi+`>dm#q1Y{0s~t&ktfQGrh9%s>My zz{extp3+N~jRSKy{)Rv^e zXouF)F+?^-gL)UEAnjVBE;~Qk>udtNbp;;od_{OpXmpT{$XqtEyDXFR1m`81lHusxF(@wXi zH>D>O9=wDt>vte%T-J?oixCWCk2v$uJ9iVSu^0gdAr&3{TpN##kO6GT7Bt}@6|yF2 zc48uGobXQm&IizWk2q4dZc$3tFGC^ERuXFhY$Kqn1^6=;;V&qKkgH)!BZ zmY_azvMuGE7Zr2uZPdnSd(B^cFiJQ$3%&n*#A1Bp{xcCvP0dQ~`f>gJRr}(}vhT#u zaKFh(0P(MQlxI%J*1aJU=*T)o6xS%fy(M!LZ|*Jh?R{HQv8bxE?%W33N~9ws3=vM43C@c0q=zeT%+7am?Ie!Eje zhZA`#>8nfK?=&w37xO`8(xTz<*{!YDbu*JcA{{XFbCH(#7cc3C>CguqeEQS^xk5 literal 0 HcmV?d00001 diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..b5667fe --- /dev/null +++ b/public/index.html @@ -0,0 +1,17 @@ + + + + + + + + Hijab - App + + +
+ + + diff --git a/public/language/ar.svg b/public/language/ar.svg new file mode 100644 index 0000000..c409129 --- /dev/null +++ b/public/language/ar.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/language/china.svg b/public/language/china.svg new file mode 100644 index 0000000..f109281 --- /dev/null +++ b/public/language/china.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/public/language/de.svg b/public/language/de.svg new file mode 100644 index 0000000..543a1bc --- /dev/null +++ b/public/language/de.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/language/en.svg b/public/language/en.svg new file mode 100644 index 0000000..b1db6ff --- /dev/null +++ b/public/language/en.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000..080d6c7 --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..722fd7d --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,69 @@ +import { Fragment, lazy, Suspense } from 'react'; +import { Route, Routes } from 'react-router-dom' +import Loading from './Components/Utils/Loading/Loading'; +import { RoutesLinks } from './Routes'; +import Layout from './Layout/app/Layout'; +import Auth from './Pages/Auth/Page'; +const Page404 = lazy(() => import("./Layout/app/NotFoundPage")) + +const App = () => { + + + return ( + + {/* 404 Page */} + }> } /> + {/* Login Page */} + }> } /> + + {/* route not in navigation */} + + + {/* All Routes */} + {RoutesLinks?.map((item: any, index: number) => ( + + + + + if(item?.element){ + } > + + {item?.element ?? "Please Add Element Props in Routes"} + + + } + /> + }else{ + item?.children?.map((item:any)=>{ + return( + } > + + {item?.element ?? "Please Add Element Props in Routes"} + + + } + /> + ) + }) + + } + + + + )) + } + + + + + ) +} + +export default App \ No newline at end of file diff --git a/src/Components/Columns/ColumnsImage.tsx b/src/Components/Columns/ColumnsImage.tsx new file mode 100644 index 0000000..11f5486 --- /dev/null +++ b/src/Components/Columns/ColumnsImage.tsx @@ -0,0 +1,86 @@ +import { + DownloadOutlined, + RotateLeftOutlined, + RotateRightOutlined, + SwapOutlined, + ZoomInOutlined, + ZoomOutOutlined, +} from '@ant-design/icons'; +import React from 'react'; +import { Image, Space } from 'antd'; +import { ImageBaseURL } from '../../api/config'; +import useImageError from '../../Hooks/useImageError'; + + +const ColumnsImage= ({src}:any) => { + const ErrorImage = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/832px-No-Image-Placeholder.svg.png" + + const imageUrl = ImageBaseURL + src || ErrorImage; + console.log(imageUrl); + + const handleError = useImageError; + // or you can download flipped and rotated image + // https://codesandbox.i`o/s/zi-ding-yi-gong-ju-lan-antd-5-7-0-forked-c9jvmp + const onDownload = () => { + fetch(src) + .then((response) => response.blob()) + .then((blob) => { + const url = URL.createObjectURL(new Blob([blob])); + const link = document.createElement('a'); + link.href = url; + link.download = 'image.png'; + document.body.appendChild(link); + link.click(); + URL.revokeObjectURL(url); + link.remove(); + }); + }; + + return ( + ( + + + + + + + + + + ), + }} + onError={handleError} + + /> + ); +}; + +export default ColumnsImage; + + + + + + + +// { +// name: t("image"), +// center: "true", +// cell: (row: any) => { +// return ( +// +// ) +// } +// }, \ No newline at end of file diff --git a/src/Components/Columns/ColumnsSwitch.tsx b/src/Components/Columns/ColumnsSwitch.tsx new file mode 100644 index 0000000..1b155b4 --- /dev/null +++ b/src/Components/Columns/ColumnsSwitch.tsx @@ -0,0 +1,42 @@ +import { Switch } from 'antd' +import React from 'react' +import { CheckOutlined, CloseOutlined } from '@ant-design/icons'; +import { useFormikContext } from 'formik'; +export interface ColumnsSwitchProps { + name: string; + Front?: string; + Back?: string; + onChange?: (checked:any,event:any) => any; + icon?: boolean + Checked?:boolean + +} +const ColumnsSwitch = (props: ColumnsSwitchProps) => { + const { name, Front, Back, icon, onChange } = props; + const formik = useFormikContext(); + const onSwitchChange = (checked: boolean, event: Event) => { + // formik.setFieldValue("status", checked) + + + + }; + return ( + : Front} + unCheckedChildren={icon ? : Back} + onChange={ (checked:any,event:any)=> onChange ? onChange(checked,event) : onSwitchChange(checked,event)} + /> + ) +} + +export default ColumnsSwitch + + +ColumnsSwitch.defaultProps = { + Front: "Front", + Back: "Back", + onChange: undefined, + icon: false, + Checked:false + +}; \ No newline at end of file diff --git a/src/Components/Ui/Alert.tsx b/src/Components/Ui/Alert.tsx new file mode 100644 index 0000000..c232160 --- /dev/null +++ b/src/Components/Ui/Alert.tsx @@ -0,0 +1,50 @@ +import React from "react"; +import { confirmAlert } from "react-confirm-alert"; +import SweetAlert from "react-bootstrap-sweetalert"; +import { useTranslation } from "react-i18next"; + +export default function CustomConfirmAlert(options : any) { + confirmAlert({ + customUI: ({ onClose }) => , + }); +} + +type CustomUIProps ={ + onClose :()=> void + options:{ + title?:string + confirmBtnText:string + cancelBtnText:string + body:string + onConfirm:()=>void + + + } +} +function CustomUI({ onClose, options }:CustomUIProps) { + + + const [t] = useTranslation() + return ( +
+ { + options.onConfirm(); + onClose(); + }} + onCancel={onClose} + + /> +
+ + ); +} diff --git a/src/Components/Ui/CheckboxesVuexy.tsx b/src/Components/Ui/CheckboxesVuexy.tsx new file mode 100644 index 0000000..5bc635e --- /dev/null +++ b/src/Components/Ui/CheckboxesVuexy.tsx @@ -0,0 +1,49 @@ +import React from 'react'; + +interface CheckBoxesVuexyProps { + className?: string; + color: string; + defaultChecked?: boolean; + checked?: boolean; + value?: string; + disabled?: boolean; + onClick?: () => void; + onChange?: () => void; + size?: string; + icon: React.ReactNode; + label: string; +} + +const CheckBoxesVuexy: React.FC = ({ + className = '', + color, + defaultChecked, + checked, + value, + disabled, + onClick, + onChange, + size = 'md', + icon, + label, +}) => { + return ( +
+ + + {icon} + + {label} +
+ ); +}; + +export default CheckBoxesVuexy; diff --git a/src/Components/Ui/FileInput.tsx b/src/Components/Ui/FileInput.tsx new file mode 100644 index 0000000..94c5df0 --- /dev/null +++ b/src/Components/Ui/FileInput.tsx @@ -0,0 +1,27 @@ +import React from 'react' +import 'bootstrap/dist/css/bootstrap.min.css'; +import { Input } from 'reactstrap'; +import { useFormikContext } from 'formik'; + +type FileInputProps = { + name:string, + label:string, + accept:string, + onChange:any +} +function FileInput({name , accept="image/*" ,label , onChange} :FileInputProps) { + + + return ( +
+ + + +
+ ) +} + +export default FileInput \ No newline at end of file diff --git a/src/Components/Ui/HovarableImage.tsx b/src/Components/Ui/HovarableImage.tsx new file mode 100644 index 0000000..c56b31c --- /dev/null +++ b/src/Components/Ui/HovarableImage.tsx @@ -0,0 +1,37 @@ +import React from "react"; +import { Tooltip } from "reactstrap"; + +const tooltipStyle = { + backgroundColor: "white", + border: "2px solid lightgrey", + maxWidth: "400px", +}; + +const HovarableImage = ({ id, src, imgPreviewProps = {}, ...props }:any) => { + const [isOpen, setIsOpen] = React.useState(false); + const ID = `image_hover_tooltip_${id}`; + const toggleTooltip = React.useCallback(() => setIsOpen((prev) => !prev), []); + + return ( +
+ {props.alt} + + {props.alt} + +
+ ); +}; + +export default HovarableImage; + diff --git a/src/Components/Ui/ImagePreview.tsx b/src/Components/Ui/ImagePreview.tsx new file mode 100644 index 0000000..04e2177 --- /dev/null +++ b/src/Components/Ui/ImagePreview.tsx @@ -0,0 +1,34 @@ +import React from "react"; +import { useTranslation } from "react-i18next"; + +const ImagePreview = ({ preview, height = 200 }:any) => { + const [t] = useTranslation(); + + return ( +
+ {preview ? ( + + ) : ( +
{t("image_preview")}
+ )} +
+ ); +}; + +export default ImagePreview; diff --git a/src/Components/Ui/LoadingButton.tsx b/src/Components/Ui/LoadingButton.tsx new file mode 100644 index 0000000..248c486 --- /dev/null +++ b/src/Components/Ui/LoadingButton.tsx @@ -0,0 +1,13 @@ +import React from "react"; +import { Button, Spinner } from "reactstrap"; + +const LoadingButton = ({ isLoading = false, ...props }) => { + return ( + + ); +}; + +export { LoadingButton }; diff --git a/src/Components/Ui/LoadingSpinner.tsx b/src/Components/Ui/LoadingSpinner.tsx new file mode 100644 index 0000000..efa5055 --- /dev/null +++ b/src/Components/Ui/LoadingSpinner.tsx @@ -0,0 +1,10 @@ +import { Spin } from 'antd' +import React from 'react' + +function LoadingSpinner() { + return ( + + ) +} + +export default LoadingSpinner \ No newline at end of file diff --git a/src/Components/Ui/PasswordField/PasswordField.tsx b/src/Components/Ui/PasswordField/PasswordField.tsx new file mode 100644 index 0000000..32489d7 --- /dev/null +++ b/src/Components/Ui/PasswordField/PasswordField.tsx @@ -0,0 +1,57 @@ +import React, { FC, useState } from "react"; +import { ErrorMessage, useField, Field } from "formik"; +import { FormGroup } from "reactstrap"; +// import PropTypes from "prop-types"; +import { Eye, EyeOff } from "react-feather"; +import "./index.css"; + +interface PasswordFieldProps { + name: string; + label?: string; +} + +const PasswordField: FC = ({ name, label, ...props }) => { + const [field, meta] = useField({ name, ...props }); + const [showPassword, setShowPassword] = useState(false); + const EyeIcon = showPassword ? Eye : EyeOff; + + const toggleShow = () => { + setShowPassword((prev) => !prev); + }; + + return ( + <> + {label && } + + +
+ +
+ +
+ + ); +}; + +// PasswordField.propTypes = { +// name: PropTypes.string.isRequired, +// }; + +export { PasswordField }; \ No newline at end of file diff --git a/src/Components/Ui/PasswordField/index.css b/src/Components/Ui/PasswordField/index.css new file mode 100644 index 0000000..7a26d93 --- /dev/null +++ b/src/Components/Ui/PasswordField/index.css @@ -0,0 +1,10 @@ +.back-icon { + font-size: 18px; + margin: 0; + margin-right: 5px; +} + +.back-btn { + padding-left: 0.8rem; + padding-right: 1rem; +} diff --git a/src/Components/Ui/ProgressBar.tsx b/src/Components/Ui/ProgressBar.tsx new file mode 100644 index 0000000..146339f --- /dev/null +++ b/src/Components/Ui/ProgressBar.tsx @@ -0,0 +1,24 @@ +import React from "react"; +import { Progress } from "reactstrap"; + +const ProgressBar = ({ value,isLoading, isSuccess, isError }:any) => { + + + let color = ""; + if (!isLoading && isSuccess) { + color = "success"; + } + if (!isLoading && isError) { + color = "danger"; + } + return ( +
+ + {value}% + +
+ ); +}; + + +export default ProgressBar; diff --git a/src/Components/Ui/SelectField.tsx b/src/Components/Ui/SelectField.tsx new file mode 100644 index 0000000..f794e31 --- /dev/null +++ b/src/Components/Ui/SelectField.tsx @@ -0,0 +1,29 @@ +import React from "react"; +import Select from "react-select"; +import { ValidatedField } from "./ValidatedField"; +import { useFormikContext } from "formik"; + +const SelectField = ({ label, name, options, ...props }:any) => { + const formik = useFormikContext(); + + return ( + opt.value === formik?.values[name]) || ""} + onChange={(opt:any) => formik.setFieldValue(name, opt.value)} + onBlur={() => formik.setFieldTouched(name)} + key={name} + {...props} + /> + ); +}; + + +export default SelectField; + + diff --git a/src/Components/Ui/StaticsCard/StaticCard.tsx b/src/Components/Ui/StaticsCard/StaticCard.tsx new file mode 100644 index 0000000..bd5fddc --- /dev/null +++ b/src/Components/Ui/StaticsCard/StaticCard.tsx @@ -0,0 +1,58 @@ +import React from "react"; +import { Card, CardBody } from "reactstrap"; +import { ChartTypeEnum } from "../../../enums/ChartTypeEnum"; +import { history } from "../../../ProviderContainer"; +import { useNavigate } from "react-router-dom"; + +interface StatisticsCardProps { + className?: string; + iconLeft?: boolean; + icon: React.ReactNode; + count?: string; + CardTitle?: string; + CardContent?: string; + height?: number; + pathWhenClick :string ; + +} + +const StatisticsCard = (props :StatisticsCardProps) => { + + const navigate = useNavigate() + const { + className, + iconLeft = false , + icon, + count, + CardTitle, + CardContent, + pathWhenClick, + height, + ...rest + } = props; + + return ( + navigate(pathWhenClick )}> + +
+
+ {/*

{CardTitle}

*/} +
{icon}
+
+
+
+ {/*

{count}

*/} +

{CardContent}

+
+
+
+ ); +}; + +export default StatisticsCard; diff --git a/src/Components/Ui/StatusBadge.tsx b/src/Components/Ui/StatusBadge.tsx new file mode 100644 index 0000000..1fb55e6 --- /dev/null +++ b/src/Components/Ui/StatusBadge.tsx @@ -0,0 +1,17 @@ +import React from "react"; +import { useTranslation } from "react-i18next"; +import { Badge } from "reactstrap"; + +const StatusBadge = ({ status }:any) => { + const [t] = useTranslation(); + + return ( + + {status ? t("active") : t("inacticve")} + + ); +}; + + + +export default StatusBadge; diff --git a/src/Components/Ui/TableActions.tsx b/src/Components/Ui/TableActions.tsx new file mode 100644 index 0000000..73c9563 --- /dev/null +++ b/src/Components/Ui/TableActions.tsx @@ -0,0 +1,38 @@ +import React , {ReactNode} from "react"; +import confirmAlert from "./Alert"; +import { FaEdit, FaTrash } from "react-icons/fa"; + +type TableActionsProps = { + onDelete: () => any; + onEdit: () => void; + showEdit?: boolean; + showDelete?: boolean; + children?: ReactNode; +}; + + +const TableActions = ({ onDelete , onEdit,showEdit=true,showDelete=true, children }:TableActionsProps) => { + + + return ( +
+ {showEdit && } + {showDelete && ( + + confirmAlert({ + onConfirm: () => { + onDelete(); + + }, + }) + } + className="cursor-pointer" + size={20} + /> + )} + {children} +
+); +}; +export default TableActions; diff --git a/src/Components/Ui/ThreeSwitchState/TripleSwitch.tsx b/src/Components/Ui/ThreeSwitchState/TripleSwitch.tsx new file mode 100644 index 0000000..c36ffbd --- /dev/null +++ b/src/Components/Ui/ThreeSwitchState/TripleSwitch.tsx @@ -0,0 +1,31 @@ +import React from 'react'; +import type { RadioChangeEvent } from 'antd'; +import { Radio } from 'antd'; + +const onChange = (e: RadioChangeEvent) => { + console.log(`radio checked:${e.target.value}`); +}; + +const App: React.FC = () => ( + <> + + + + Hangzhou + + Shanghai + + Beijing + Chengdu + + + + Hangzhou + Shanghai + Beijing + Chengdu + + +); + +export default App; diff --git a/src/Components/Ui/ToggleStatus.tsx b/src/Components/Ui/ToggleStatus.tsx new file mode 100644 index 0000000..40df144 --- /dev/null +++ b/src/Components/Ui/ToggleStatus.tsx @@ -0,0 +1,39 @@ +import React from "react"; +import Toggle from "react-toggle"; +import "react-toggle/style.css"; +import StatusBadge from "./StatusBadge"; +import { useTranslation } from "react-i18next"; + +interface ToggleStatusProps { + +} +export const ToggleStatus = ({ object, handleSwitch, toggleMutation, ...props }:any) => { + const [t] = useTranslation(); + + // const handleSwitch = () => { + // toggleMutation.mutate({ + // id: object.id, + // new_status: !object.is_active, + // }); + // }; + + return ( + <> +
+

+ {object.is_active ? t("active") : t("inactive")} +

+ +
+ + ); +}; diff --git a/src/Components/Ui/ValidatedField.tsx b/src/Components/Ui/ValidatedField.tsx new file mode 100644 index 0000000..c2bd089 --- /dev/null +++ b/src/Components/Ui/ValidatedField.tsx @@ -0,0 +1,64 @@ +import React from "react"; +import { ErrorMessage, useField, Field } from "formik"; +import { FormGroup } from "reactstrap"; +import { useTranslation } from "react-i18next"; + +const ValidatedField = ({ + name, + label, + CustomField, + icon: Icon, + optional, + labelIcon = null, + formProps, + isRequired, + + ...props +}:any) => { + + const [field, meta] = useField({ name, ...props }); + const [t] = useTranslation(); + + let Wrapper = Field; + + if (CustomField) { + Wrapper = CustomField; + } + const fieldProps = props.type === "file" ? {} : { ...field }; + + return ( + <> + {label && ( + + )} + + + {Icon && ( +
+ +
+ )} + + {(msg) => {t(msg)}} + +
+ + ); +}; + + +export { ValidatedField }; diff --git a/src/Components/Ui/index.tsx b/src/Components/Ui/index.tsx new file mode 100644 index 0000000..ae6a6f0 --- /dev/null +++ b/src/Components/Ui/index.tsx @@ -0,0 +1,17 @@ +import Checkbox from './CheckboxesVuexy' +import ImagePreview from './ImagePreview' +import SelectField from './SelectField' +import { useImagePreview } from './useImagePreview' +import {ValidatedField} from './ValidatedField' +import StatusBadge from './StatusBadge' +import HovarableImage from './HovarableImage' + +export { + Checkbox, + ImagePreview, + SelectField, + useImagePreview, + ValidatedField, + StatusBadge, + HovarableImage +} \ No newline at end of file diff --git a/src/Components/Ui/tables/Actions.tsx b/src/Components/Ui/tables/Actions.tsx new file mode 100644 index 0000000..f78e1ad --- /dev/null +++ b/src/Components/Ui/tables/Actions.tsx @@ -0,0 +1,58 @@ +import React , {ReactNode} from "react"; +import { FaEdit, FaEye, FaTrash } from "react-icons/fa"; +import CustomConfirmAlert from "../Alert"; +import { usePageState } from "../../../lib/state mangment/LayoutPagestate"; + +type TableActionsProps = { + onDelete?: () => any; + onEdit?: () => any; + onView?:() => any; + showView?: boolean; + showEdit?: boolean; + showDelete?: boolean; + children?: ReactNode; + objectToEdit:any + className?:string + +}; + + +const TableActions = ({ onDelete=()=>{} , objectToEdit,onEdit=()=>{},onView,showEdit=true,showDelete=true,showView=true,children,className }:TableActionsProps) => { +// const TableActions = ({ onDelete=()=>{} , objectToEdit,onEdit=()=>{},onView,showEdit=true,showDelete=true,showView=true,children }:TableActionsProps) => { + + // console.log(objectToEdit); + + const {setObjectToEdit , setIsOpenEditModel} = usePageState() + return ( +
+ {showEdit && { + setObjectToEdit(objectToEdit) + setIsOpenEditModel() + onEdit() + + }} className="cursor-pointer m-2" size={20} />} + {showView && } + + + {showDelete && ( + + CustomConfirmAlert({ + onConfirm: () => { + + + onDelete(); + + }, + }) + } + className="cursor-pointer" + size={20} + /> + )} + + {children} +
+); +}; +export default TableActions; diff --git a/src/Components/Ui/tables/ConfirmAlert.tsx b/src/Components/Ui/tables/ConfirmAlert.tsx new file mode 100644 index 0000000..bb99f66 --- /dev/null +++ b/src/Components/Ui/tables/ConfirmAlert.tsx @@ -0,0 +1,40 @@ +import React from "react"; +import { confirmAlert } from "react-confirm-alert"; +import SweetAlert from "react-bootstrap-sweetalert"; + +interface CustomUIProps { + onClose: () => void; + options: { + title?: string; + confirmBtnText?: string; + cancelBtnText?: string; + onConfirm: () => void; + body?: string; + }; +} + +export default function CustomConfirmAlert(options: any) { + confirmAlert({ + customUI: ({ onClose }) => , + }); +} + +function CustomUI({ onClose, options }: CustomUIProps) { + const sweetAlertProps: any = { + title: options.title || `DELETE, Are you sure?`, + warning: true, + show: true, + showCancel: true, + reverseButtons: true, + cancelBtnBsStyle: "danger", + confirmBtnText: options.confirmBtnText || "Yes, delete it!", + cancelBtnText: options.cancelBtnText || "Cancel", + onConfirm: () => { + options.onConfirm(); + onClose(); + }, + onCancel: onClose, + }; + + return {options.body || "You won't be able to revert this!"}; +} diff --git a/src/Components/Ui/useImagePreview.tsx b/src/Components/Ui/useImagePreview.tsx new file mode 100644 index 0000000..818c68e --- /dev/null +++ b/src/Components/Ui/useImagePreview.tsx @@ -0,0 +1,24 @@ +import { useState, useEffect } from "react"; + +export const useImagePreview = (defaultValue:any = null) => { + const [preview, setPreview] = useState(defaultValue || null); + + useEffect(() => { + return () => { + URL.revokeObjectURL(preview); + + }; + }, [preview]); + + const handleImageChange = (event:any) => { + + setPreview(URL.createObjectURL(event.target.files[0])); + + }; + + return { + preview, + handleImageChange, + setPreview, + }; +}; diff --git a/src/Components/Utils/BlockModal.tsx b/src/Components/Utils/BlockModal.tsx new file mode 100644 index 0000000..d6c47f0 --- /dev/null +++ b/src/Components/Utils/BlockModal.tsx @@ -0,0 +1,62 @@ + +import React, { useEffect } from 'react'; +import { useTranslation } from 'react-i18next'; +import { BsExclamationCircle } from 'react-icons/bs'; +import { Button, Card, CardBody, Input, Label, Modal, ModalHeader } from 'reactstrap'; +import { useCommonModelState } from '../../lib/state mangment/driver&customer/ModelState'; +import { LoadingButton } from '../Ui/LoadingButton'; + +interface BlockModelProps { + Mutation:any, + type :'customer' |'driver' +} + +const BlockModel: React.FC = ({Mutation ,type}) => { + const {t} = useTranslation(); + const key_to_api = type == t('customer') ? t('customer_id') : t("driver_id") + + const {isOpenBlock:isOpen , objectID , setIsopenBlock:setIsOpen} = useCommonModelState() + + const handleSubmit = () => { + const blockInput = document.getElementById('block_input') as HTMLInputElement; + if (blockInput) { + Mutation.mutate({ [key_to_api]: objectID, block_timer: blockInput.value }); + } + }; + + useEffect(() => { + if (Mutation.isSuccess) { + setIsOpen(); + } + }, [Mutation.isSuccess, setIsOpen]); + + return ( + + setIsOpen()}> + {t("al")}{type}{t('_block_page')} + + + +
+

{t('blocking_')}{type}

+ +
+ + +
+ + + {t('add_block_for_')}{type} + +
+
+
+
+
+
+ ); +}; + +export default BlockModel; diff --git a/src/Components/Utils/GiftModal.tsx b/src/Components/Utils/GiftModal.tsx new file mode 100644 index 0000000..bbd8d3e --- /dev/null +++ b/src/Components/Utils/GiftModal.tsx @@ -0,0 +1,63 @@ +import React, { useEffect } from 'react'; +import { useTranslation } from 'react-i18next'; +import { BsExclamationCircle } from 'react-icons/bs'; +import { Button, Card, CardBody, Col, Input, Label, Modal, ModalHeader, Row } from 'reactstrap'; +import { useCommonModelState } from '../../lib/state mangment/driver&customer/ModelState'; +import { LoadingButton } from '../Ui/LoadingButton'; + + +interface GiftModalProps { + Mutation:any, + type :'customer' |'driver' +} + +const GiftModal: React.FC = ({Mutation ,type }) => { + const {t} = useTranslation(); + + const {isOpenGift:isOpen , objectID , setIsopenGift:setIsOpen} = useCommonModelState() + + useEffect(() => { + if (Mutation.isSuccess) { + setIsOpen(); + } + }, [Mutation.isSuccess, setIsOpen]); + + const handleGift = () => { + const enterCodesInput = document.getElementById('enter_codes') as HTMLInputElement; + if (enterCodesInput && enterCodesInput.value) { + Mutation.mutate({ type, id: objectID, value: enterCodesInput.value }); + } + }; + + return ( + + setIsOpen()}> + {t("al")}{type} {t('_gift_page')} + + + + + + + + + + + {t('give')} + + + + + + + + ); +}; + +export default GiftModal; diff --git a/src/Components/Utils/Loading/Loading.scss b/src/Components/Utils/Loading/Loading.scss new file mode 100644 index 0000000..9ffb658 --- /dev/null +++ b/src/Components/Utils/Loading/Loading.scss @@ -0,0 +1,93 @@ +.Loading{ + + .wrapper { + width: 200px; + height: 60px; + position: relative; + left: 40%; + z-index: 1; + } + + .circle { + width: 20px; + height: 20px; + position: absolute; + border-radius: 50%; + background-color: var(--primary); + left: 15%; + transform-origin: 50%; + animation: circle7124 .5s alternate infinite ease; + } + + @keyframes circle7124 { + 0% { + top: 60px; + height: 5px; + border-radius: 50px 50px 25px 25px; + transform: scaleX(1.7); + } + + 40% { + height: 20px; + border-radius: 50%; + transform: scaleX(1); + } + + 100% { + top: 0%; + } + } + + .circle:nth-child(2) { + left: 45%; + animation-delay: .2s; + } + + .circle:nth-child(3) { + left: auto; + right: 15%; + animation-delay: .3s; + } + + .shadow { + width: 20px; + height: 4px; + border-radius: 50%; + background-color: rgba(0,0,0,0.9); + position: absolute; + top: 62px; + transform-origin: 50%; + z-index: -1; + left: 15%; + filter: blur(1px); + animation: shadow046 .5s alternate infinite ease; + } + + @keyframes shadow046 { + 0% { + transform: scaleX(1.5); + } + + 40% { + transform: scaleX(1); + opacity: .7; + } + + 100% { + transform: scaleX(.2); + opacity: .4; + } + } + + .shadow:nth-child(4) { + left: 45%; + animation-delay: .2s + } + + .shadow:nth-child(5) { + left: auto; + right: 15%; + animation-delay: .3s; + } + +} diff --git a/src/Components/Utils/Loading/Loading.tsx b/src/Components/Utils/Loading/Loading.tsx new file mode 100644 index 0000000..19651b4 --- /dev/null +++ b/src/Components/Utils/Loading/Loading.tsx @@ -0,0 +1,19 @@ +import React from 'react' +import './Loading.scss' +const Loading = () => { + + return ( +
+
+
+
+
+
+
+
+
+
+ ) +} + +export default Loading \ No newline at end of file diff --git a/src/Components/Utils/SearchBar/SearchBar.scss b/src/Components/Utils/SearchBar/SearchBar.scss new file mode 100644 index 0000000..6834dcf --- /dev/null +++ b/src/Components/Utils/SearchBar/SearchBar.scss @@ -0,0 +1,43 @@ +.SearchBar{ + .group { + display: flex; + align-items: center; + position: relative; + max-width: 190px; + } + + .input { + width: 100%; + height: 40px; + padding: 0 1rem; + padding-left: 2.5rem; + border-radius: 8px; + outline: none; + font-weight: 500; + background: var(--primary); + color: var(--bg); + border: none; + box-shadow: 2px 2px 7px 0 var(--primary); + + } + + .input::placeholder { + color: var(--bg); + } + + + + .icon { + position: absolute; + left: 1rem; + fill: var(--bg); + width: 1rem; + height: 1rem; + } + + + + + + +} \ No newline at end of file diff --git a/src/Components/Utils/SearchBar/SearchBar.tsx b/src/Components/Utils/SearchBar/SearchBar.tsx new file mode 100644 index 0000000..f1f5cd2 --- /dev/null +++ b/src/Components/Utils/SearchBar/SearchBar.tsx @@ -0,0 +1,14 @@ +import React from 'react' +import './SearchBar.scss' +const SearchBar = () => { + return ( +
+
+ + +
+
+ ) +} + +export default SearchBar \ No newline at end of file diff --git a/src/Components/Utils/Theme.tsx b/src/Components/Utils/Theme.tsx new file mode 100644 index 0000000..7681ffd --- /dev/null +++ b/src/Components/Utils/Theme.tsx @@ -0,0 +1,84 @@ +import { Menu, MenuItem, MenuButton } from '@szhsin/react-menu'; +import { useTranslation } from 'react-i18next'; +import { usePageState } from '../../lib/state mangment/LayoutPagestate'; +import { BsFillMoonStarsFill, BsFillSunFill, BsSunglasses } from 'react-icons/bs'; + + +let What_the_Theme = localStorage.getItem('theme') ?? "light"; + +if (What_the_Theme === "dark") { + + document.body.classList.add('dark')} + else if (What_the_Theme === "glass") { + + document.body.classList.add('glass') + } + + + + +export default function Theme() { + const {t} = useTranslation(); + + const {setThemChange} = usePageState() + + const changeTheme = (newTheme : any) => { + + + if(newTheme === "dark"){ + document.body.classList.remove('glass'); + document.body.classList.add('dark');localStorage.setItem("theme", "dark"); + What_the_Theme = "dark" + } + else if(newTheme === "light"){ + document.body.classList.remove('glass'); + document.body.classList.remove('dark');localStorage.setItem("theme", "light"); + What_the_Theme = "light" + + } + else if(newTheme === "glass"){ + document.body.classList.remove('dark'); document.body.classList.add('glass'); localStorage.setItem("theme", "glass"); + What_the_Theme = "glass" + + } + setThemChange() + }; + /// BsSunglasses BsFillSunFill BsFillMoonStarsFill + + + return ( +
+ + {(What_the_Theme === "light") ? + <> + + {t("light")} + + + : (What_the_Theme === "dark") ? + <> + + {t("dark")} + + : + <> + + {t("glass")} + + } + } transition> + changeTheme('light')}> + + {t("light")} + + changeTheme('dark')}> + + {t("dark")} + changeTheme('glass')}> + + {t("glass")} + + +
+ ); +} diff --git a/src/Components/Utils/Translate.tsx b/src/Components/Utils/Translate.tsx new file mode 100644 index 0000000..a5aa816 --- /dev/null +++ b/src/Components/Utils/Translate.tsx @@ -0,0 +1,42 @@ +import React from 'react'; +import { Menu, Dropdown } from 'antd'; +import { useLanguage, useLanguageMenu } from '../../Hooks/useChangeLanguage'; +import i18next from 'i18next'; +import type { MenuProps } from 'antd'; + +export default function Translate() { + const { changeLanguage } = useLanguage(); + const { languageOptions } = useLanguageMenu(); + + const handleLanguageChange = (newLanguage:string) => { + changeLanguage(newLanguage); + }; + + const items : MenuProps['items'] = languageOptions.map((option:any,index:number) => ({ + key: index, + label: ( +
handleLanguageChange(option.code)}> + + {option.label} +
+ ) + })); + + + + return ( +
+ + + +
+ ); +} diff --git a/src/Components/Utils/UnBlockModal.tsx b/src/Components/Utils/UnBlockModal.tsx new file mode 100644 index 0000000..cf3fac1 --- /dev/null +++ b/src/Components/Utils/UnBlockModal.tsx @@ -0,0 +1,60 @@ + +import React, { useEffect } from 'react'; +import { BsExclamationCircle } from 'react-icons/bs'; +import { Button, Card, CardBody, Input, Label, Modal, ModalHeader } from 'reactstrap'; +import { useTranslation } from 'react-i18next'; +import { LoadingButton } from '../Ui/LoadingButton'; +import { useCommonModelState } from '../../lib/state mangment/driver&customer/ModelState'; +import { CiLock } from "react-icons/ci"; + +interface UnBlockModalProps { + + Mutation:any, + type :'customer' |'driver' +} + +const UnBlockModal: React.FC = ({Mutation ,type }) => { + const {t} = useTranslation(); + + const key_to_api = type == t('customer') ? t('customer_id') : t("driver_id") + + const {isOpenUnBlock:isOpen , objectID , setIsopenUnBlock:setIsopen} = useCommonModelState() + + const handleSubmit = () => { + Mutation.mutate({ [key_to_api]: objectID }); + }; + + useEffect(() => { + if (Mutation.isSuccess) { + setIsopen(); + } + }, [Mutation.isSuccess, setIsopen]); + + return ( + + setIsopen()}> + {t("al")}{type} {t('un_block_page')} + + + +
+

{t('un_blocking_')}{type}

+ +
+
+ + + {t('un_block_for_')}{type} + +
+
+
+
+
+
+ ); +}; + +export default UnBlockModal; diff --git a/src/Components/ValidationField/Ui/KarimSpinner.tsx b/src/Components/ValidationField/Ui/KarimSpinner.tsx new file mode 100644 index 0000000..12206f9 --- /dev/null +++ b/src/Components/ValidationField/Ui/KarimSpinner.tsx @@ -0,0 +1,18 @@ +import React from 'react'; +import { Spin } from 'antd'; + +interface Props { + loading: boolean; + children: React.ReactNode; + className?: string; +} + +const KarimSpinner: React.FC = ({ loading, className, children }) => { + return ( +
+ {loading ?
: children} +
+ ); +}; + +export default KarimSpinner; diff --git a/src/Components/ValidationField/Ui/SearchBar.scss b/src/Components/ValidationField/Ui/SearchBar.scss new file mode 100644 index 0000000..2ddadd9 --- /dev/null +++ b/src/Components/ValidationField/Ui/SearchBar.scss @@ -0,0 +1,48 @@ +.SearchBar{ + // margin-top: 20px; + .group { + display: flex; + align-items: center; + position: relative; + max-width: 350px; + width: 350px; + + } + + .input { + width: 100%; + height: 40px; + padding: 0 1rem; + padding-left: 2.5rem; + border-radius: 8px; + outline: none; + font-weight: 500; + background: var(--bg); + color: var(--text); + border: none; + box-shadow: 2px 2px 7px 0 var(--bg); + + } + + .input::placeholder { + color: var(--subtext); + opacity: .4; + + } + + + + .icon { + position: absolute; + left: 1rem; + fill: var(--subtext); + width: 1rem; + height: 1rem; + } + + + + + + +} \ No newline at end of file diff --git a/src/Components/ValidationField/Ui/SearchBar.tsx b/src/Components/ValidationField/Ui/SearchBar.tsx new file mode 100644 index 0000000..f70b289 --- /dev/null +++ b/src/Components/ValidationField/Ui/SearchBar.tsx @@ -0,0 +1,35 @@ +import React, { useState } from 'react' +import './SearchBar.scss' +import { useNavigate, useSearchParams } from 'react-router-dom'; +const SearchBar = () => { + const [searchQuery, setSearchQuery] = useState(''); + const [searchParams] = useSearchParams() + const navigate = useNavigate(); + + const handleChange = (event:any) => { + const { value } = event.target; + setSearchQuery(value); + updateUrlParams(value); + }; + + const updateUrlParams = (value:any) => { + navigate(`?search=${value}`); + + + }; + + return ( +
+
+ + +
+
+ ) +} + +export default SearchBar \ No newline at end of file diff --git a/src/Components/ValidationField/ValidationField.scss b/src/Components/ValidationField/ValidationField.scss new file mode 100644 index 0000000..97e9f5e --- /dev/null +++ b/src/Components/ValidationField/ValidationField.scss @@ -0,0 +1,78 @@ +.ValidationField{ + >*{ + width: 100%; + } + .text,.ant-form-item{ + margin-bottom:7px !important; + + } + + >span{ + margin-bottom: 0px !important; + &:focus-within{ + border-color: var(--primary) ; + box-shadow: 0 0 0 1px var(--primary); + cursor: pointer; + } + &:has(.is-invalid){ + border-color: red !important; + + } + input{ + color: var(--text); + background: var(--bg); + } + +input:-webkit-autofill, +input:-webkit-autofill:hover, +input:-webkit-autofill:focus, +input:-webkit-autofill:active{ + -webkit-box-shadow: 0 0 0 30px white inset !important; +} + } +} + +.ant-upload-select{ + width: 100%; +} +.Checkboxs{ + padding: 4%; +} +.SearchField{ + button{ + background: var(--primary); + } +} +.text{ + color: var(--text); +} + +input:disabled{ + color: var(--text) !important; +} + +.isError{ + outline: red 1px solid; + color: red; +} +.Error_color{ + color: red; + +} +input:-webkit-autofill { + -webkit-box-shadow: 0 0 0 1000px white inset !important; /* Change the color to your desired background color */ +} +input:-webkit-autofill:focus { + -webkit-box-shadow: 0 0 0 1000px white inset !important; /* Change the color to your desired background color */ +} + +/* Remove autofill background color on hover */ +input:-webkit-autofill:hover { + -webkit-box-shadow: 0 0 0 1000px white inset !important; /* Change the color to your desired background color */ +} + + +.ant-upload-list .ant-upload-list-item{ + height:78px !important; + } + \ No newline at end of file diff --git a/src/Components/ValidationField/ValidationField.tsx b/src/Components/ValidationField/ValidationField.tsx new file mode 100644 index 0000000..6e25672 --- /dev/null +++ b/src/Components/ValidationField/ValidationField.tsx @@ -0,0 +1,34 @@ +import React from "react"; +import "./ValidationField.scss"; +import { Date, Time, File, DataRange, SelectField, Default, CheckboxField ,TextAreaField} from './View'; +import { ValidationFieldProps } from "./types"; +import MaltyFile from "./View/MaltyFile"; +import SearchField from "./View/SearchField"; + +const ValidationField: React.FC = ({type , ...otherProps}) => { + + switch (type) { + case 'Select': + return ; + case 'Search': + return ; + case "DataRange": + return ; + case "Date": + return ; + case "Time": + return