diff --git a/.vscode/settings.json b/.vscode/settings.json index 6a521b2..ebc5ec0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { "cSpell.words": [ "aldeen", + "antd", "Datepicker", "formik", "Karim", diff --git a/public/index.html b/index.html similarity index 86% rename from public/index.html rename to index.html index 70b45ee..8168fa3 100644 --- a/public/index.html +++ b/index.html @@ -10,6 +10,7 @@ E-Menu - App +
diff --git a/package.json b/package.json index 6986b43..d244094 100644 --- a/package.json +++ b/package.json @@ -4,85 +4,48 @@ "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", - "google-map-react": "^2.2.1", - "history": "^5.3.0", - "i18next": "^23.6.0", - "i18next-browser-languagedetector": "^7.1.0", - "json-server": "^0.17.4", + "@types/node": "^16.18.97", + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", + "antd": "^5.17.4", + "apexcharts": "^3.49.1", + "axios": "^1.7.2", + "bootstrap": "^5.3.3", + "chart.js": "^4.4.3", + "dayjs": "^1.11.11", + "formik": "^2.4.6", + "i18next": "^23.11.5", "leaflet": "^1.9.4", - "moment": "^2.30.1", - "prop-types": "^15.8.1", - "react": "^18.2.0", + "react": "^18.3.1", "react-apexcharts": "^1.4.1", - "react-bootstrap": "^2.9.1", + "react-bootstrap": "^2.10.2", "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-data-table-component": "^7.6.2", + "react-dom": "^18.3.1", + "react-i18next": "^13.5.0", + "react-icons": "^4.12.0", "react-leaflet": "^4.2.1", - "react-number-format": "^5.3.4", + "react-number-format": "^5.4.0", "react-player": "^2.16.0", "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-router-dom": "^6.23.1", + "react-select": "^5.8.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", + "reactstrap": "^9.2.2", + "sass": "^1.77.4", "typescript": "^4.9.5", "web-vitals": "^2.1.4", "xlsx": "^0.18.5", - "yup": "^1.3.2", - "zustand": "^4.4.5" + "yup": "^1.4.0", + "zustand": "^4.5.2" }, "scripts": { - "start": "react-scripts start", + "start": "vite", "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 " + "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ diff --git a/public/Layout/images.png b/public/Layout/images.png new file mode 100644 index 0000000..a283724 Binary files /dev/null and b/public/Layout/images.png differ diff --git a/public/Logo.png b/public/Logo.png index 2c0068f..56736b1 100644 Binary files a/public/Logo.png and b/public/Logo.png differ diff --git a/src/Components/Ui/tables/Actions.tsx b/src/Components/Ui/tables/Actions.tsx index f78e1ad..cce85cc 100644 --- a/src/Components/Ui/tables/Actions.tsx +++ b/src/Components/Ui/tables/Actions.tsx @@ -1,7 +1,7 @@ import React , {ReactNode} from "react"; import { FaEdit, FaEye, FaTrash } from "react-icons/fa"; import CustomConfirmAlert from "../Alert"; -import { usePageState } from "../../../lib/state mangment/LayoutPagestate"; +import { usePageState } from "../../../lib/statemangment/LayoutPagestate"; type TableActionsProps = { onDelete?: () => any; diff --git a/src/Components/Utils/BlockModal.tsx b/src/Components/Utils/BlockModal.tsx index d6c47f0..f12aa9d 100644 --- a/src/Components/Utils/BlockModal.tsx +++ b/src/Components/Utils/BlockModal.tsx @@ -3,7 +3,7 @@ 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 { useCommonModelState } from '../../lib/statemangment/driver&customer/ModelState'; import { LoadingButton } from '../Ui/LoadingButton'; interface BlockModelProps { @@ -20,7 +20,7 @@ const BlockModel: React.FC = ({Mutation ,type}) => { const handleSubmit = () => { const blockInput = document.getElementById('block_input') as HTMLInputElement; if (blockInput) { - Mutation.mutate({ [key_to_api]: objectID, block_timer: blockInput.value }); + Mutation.mutate({ [key_to_api]: objectID, block_timer: blockvalue }); } }; diff --git a/src/Components/Utils/GiftModal.tsx b/src/Components/Utils/GiftModal.tsx index bbd8d3e..ace3d1d 100644 --- a/src/Components/Utils/GiftModal.tsx +++ b/src/Components/Utils/GiftModal.tsx @@ -2,7 +2,7 @@ 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 { useCommonModelState } from '../../lib/statemangment/driver&customer/ModelState'; import { LoadingButton } from '../Ui/LoadingButton'; @@ -24,8 +24,8 @@ const GiftModal: React.FC = ({Mutation ,type }) => { const handleGift = () => { const enterCodesInput = document.getElementById('enter_codes') as HTMLInputElement; - if (enterCodesInput && enterCodesInput.value) { - Mutation.mutate({ type, id: objectID, value: enterCodesInput.value }); + if (enterCodesInput && enterCodesvalue) { + Mutation.mutate({ type, id: objectID, value: enterCodesvalue }); } }; diff --git a/src/Components/Utils/Theme.tsx b/src/Components/Utils/Theme.tsx index 7681ffd..41cd9f3 100644 --- a/src/Components/Utils/Theme.tsx +++ b/src/Components/Utils/Theme.tsx @@ -1,6 +1,6 @@ import { Menu, MenuItem, MenuButton } from '@szhsin/react-menu'; import { useTranslation } from 'react-i18next'; -import { usePageState } from '../../lib/state mangment/LayoutPagestate'; +import { usePageState } from '../../lib/statemangment/LayoutPagestate'; import { BsFillMoonStarsFill, BsFillSunFill, BsSunglasses } from 'react-icons/bs'; diff --git a/src/Components/Utils/UnBlockModal.tsx b/src/Components/Utils/UnBlockModal.tsx index cf3fac1..85a8e3c 100644 --- a/src/Components/Utils/UnBlockModal.tsx +++ b/src/Components/Utils/UnBlockModal.tsx @@ -4,7 +4,7 @@ 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 { useCommonModelState } from '../../lib/statemangment/driver&customer/ModelState'; import { CiLock } from "react-icons/ci"; interface UnBlockModalProps { diff --git a/src/Components/ValidationField/Ui/KarimSpinner.tsx b/src/Components/ValidationField/Ui/KarimSpinner.tsx index 12206f9..53a29d4 100644 --- a/src/Components/ValidationField/Ui/KarimSpinner.tsx +++ b/src/Components/ValidationField/Ui/KarimSpinner.tsx @@ -1,5 +1,5 @@ -import React from 'react'; -import { Spin } from 'antd'; +import React from "react"; +import { Spin } from "antd"; interface Props { loading: boolean; @@ -10,7 +10,13 @@ interface Props { const KarimSpinner: React.FC = ({ loading, className, children }) => { return (
- {loading ?
: children} + {loading ? ( +
+ +
+ ) : ( + children + )}
); }; diff --git a/src/Components/ValidationField/Ui/SearchBar.scss b/src/Components/ValidationField/Ui/SearchBar.scss index 2ddadd9..9dc4900 100644 --- a/src/Components/ValidationField/Ui/SearchBar.scss +++ b/src/Components/ValidationField/Ui/SearchBar.scss @@ -1,48 +1,37 @@ -.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); +.SearchBar { + // margin-top: 20px; + .group { + display: flex; + align-items: center; + position: relative; + max-width: 350px; + width: 350px; + } - } - - .input::placeholder { - color: var(--subtext); - opacity: .4; - - } - + .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); + } - - .icon { - position: absolute; - left: 1rem; - fill: var(--subtext); - width: 1rem; - height: 1rem; - } - - - - - - -} \ No newline at end of file + .input::placeholder { + color: var(--subtext); + opacity: 0.4; + } + + .icon { + position: absolute; + left: 1rem; + fill: var(--subtext); + width: 1rem; + height: 1rem; + } +} diff --git a/src/Components/ValidationField/Ui/SearchBar.tsx b/src/Components/ValidationField/Ui/SearchBar.tsx index f70b289..46d2566 100644 --- a/src/Components/ValidationField/Ui/SearchBar.tsx +++ b/src/Components/ValidationField/Ui/SearchBar.tsx @@ -1,35 +1,45 @@ -import React, { useState } from 'react' -import './SearchBar.scss' -import { useNavigate, useSearchParams } from 'react-router-dom'; +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 [searchQuery, setSearchQuery] = useState(""); + const [searchParams] = useSearchParams(); + const navigate = useNavigate(); - const handleChange = (event:any) => { - const { value } = event.target; - setSearchQuery(value); - updateUrlParams(value); - }; + const handleChange = (event: any) => { + const { value } = event.target; + setSearchQuery(value); + updateUrlParams(value); + }; - const updateUrlParams = (value:any) => { - navigate(`?search=${value}`); + const updateUrlParams = (value: any) => { + navigate(`?search=${value}`, { replace: true }); + }; - - }; + return ( +
+
+ + +
+
+ ); +}; - return ( -
-
- - -
-
- ) -} - -export default SearchBar \ No newline at end of file +export default SearchBar; diff --git a/src/Components/ValidationField/ValidationField.scss b/src/Components/ValidationField/ValidationField.scss deleted file mode 100644 index 97e9f5e..0000000 --- a/src/Components/ValidationField/ValidationField.scss +++ /dev/null @@ -1,78 +0,0 @@ -.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 index 6e25672..7d3cc79 100644 --- a/src/Components/ValidationField/ValidationField.tsx +++ b/src/Components/ValidationField/ValidationField.tsx @@ -1,34 +1,46 @@ 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"; +import "./utils/ValidationField.scss"; +import { + Date, + Time, + File, + DataRange, + SelectField, + Default, + CheckboxField, + MaltyFile, + SearchField, + TextField, + DropFile, +} from "./View"; +import { ValidationFieldProps, ValidationFieldType } from "./utils/types"; +import LocalSearchField from "./View/LocalSearch"; +import NumberFormate from "./View/NumberFormate"; -const ValidationField: React.FC = ({type , ...otherProps}) => { - - switch (type) { - case 'Select': - return ; - case 'Search': - return ; - case "DataRange": - return ; - case "Date": - return ; - case "Time": - return