diff --git a/components/panel/addDoctor/index.js b/components/panel/addDoctor/index.js index f2ead96..4a7a2be 100644 --- a/components/panel/addDoctor/index.js +++ b/components/panel/addDoctor/index.js @@ -9,7 +9,7 @@ import GeneralInformation from "./listMenu/generalInformation"; import Step from "./Step"; function AddDoctorPage() { - const [value, setValue] = useState(2); + const [value, setValue] = useState(1); const [data, setData] = useState({ general: { name: { value: "", placeholder: "احسان احمدی", isEdit: true }, @@ -25,7 +25,7 @@ function AddDoctorPage() { degree: { value: "", isEdit: true }, }, office: { - address: { value: "", isEdit: true }, + address: { value: "مپ", isEdit: true }, phone: { value: "", placeholder: 1741025645, isEdit: true }, office_number1: { value: "", isEdit: true }, office_number2: { value: "", isEdit: true }, @@ -83,7 +83,6 @@ function AddDoctorPage() { }, ], }); - console.log(data); const components = [ setOpen(false); + const handleOpen = () => setOpen(true); + const changeData = (value, type, name) => type !== "isEdit" && setData((prev) => { @@ -23,65 +30,74 @@ function Form({ parent, data, setData }) { }); return ( -
- - - - - - - - } - isTransparent={true} - placeholder="از روی نقشه انتخاب کنید..." - iconGray={true} - changeData={changeData} - data={data?.address} - name="address" - /> - - - - - - - - - - -
+ <> +
+ + + + + + + +
+ } + isTransparent={true} + placeholder="از روی نقشه انتخاب کنید..." + iconGray={true} + changeData={changeData} + data={data?.address} + name="address" + /> +
+
+
+ + + + + + + + + +
+ + ); } diff --git a/components/panel/addDoctor/listMenu/officeInformation/modal/index.js b/components/panel/addDoctor/listMenu/officeInformation/modal/index.js new file mode 100644 index 0000000..1f1dfd5 --- /dev/null +++ b/components/panel/addDoctor/listMenu/officeInformation/modal/index.js @@ -0,0 +1,53 @@ +import { styleDefault } from "@/mui"; +import { Modal } from "@mui/material"; +import { useState } from "react"; + +import MapPicker from "react-google-map-picker"; + +const DefaultLocation = { + lat: 9.912345921562734, + lng: 105.97776559918576, +}; +const DefaultZoom = 10; + +function ModalMap({ open, handleClose }) { + const [defaultLocation, setDefaultLocation] = useState(DefaultLocation); + + const [location, setLocation] = useState(defaultLocation); + const [zoom, setZoom] = useState(DefaultZoom); + + function handleChangeLocation(lat, lng) { + setLocation({ lat: lat, lng: lng }); + } + + function handleChangeZoom(newZoom) { + setZoom(newZoom); + } + + function handleResetLocation() { + setDefaultLocation({ ...DefaultLocation }); + setZoom(DefaultZoom); + } + + return ( + +
+ +
+
+ ); +} + +export default ModalMap; diff --git a/package-lock.json b/package-lock.json index 7c807a3..647dfff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "npm": "^10.8.2", "react": "^18.0.0", "react-dom": "^18", + "react-google-map-picker": "^1.2.3", "styled-components": "^6.1.11", "stylis": "^4.3.4", "stylis-plugin-rtl": "^2.1.1", @@ -19059,6 +19060,17 @@ "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.11.tgz", "integrity": "sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg==" }, + "node_modules/react-google-map-picker": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/react-google-map-picker/-/react-google-map-picker-1.2.3.tgz", + "integrity": "sha512-XeIj0Eh0vhNToMTebQQrt5O9fdPRDf4KtG8J22xupH7Pu49J1dP5UuhfCM6VmK2nIv5ECyQUpOT6+gZgGaQhJA==", + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "react": "^17.0.0" + } + }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", diff --git a/package.json b/package.json index 1ebba13..aabda57 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "npm": "^10.8.2", "react": "^18.0.0", "react-dom": "^18", + "react-google-map-picker": "^1.2.3", "styled-components": "^6.1.11", "stylis": "^4.3.4", "stylis-plugin-rtl": "^2.1.1",