change fields component & handle edit, delete, add data and save & change functional page doctor
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
import Field from "@/app/component/element/Field";
|
||||
import {
|
||||
changeNumToDefault,
|
||||
formatPhoneNumber,
|
||||
validatePhoneNumber,
|
||||
} from "@/helper";
|
||||
import { validatePhoneNumber } from "@/helper";
|
||||
import { request } from "@/services/response";
|
||||
import { InputAdornment, Button } from "@mui/material";
|
||||
import Link from "next/link";
|
||||
@@ -14,15 +10,14 @@ function LogInPage({ setIsSendMsg, num, setNum, setUuid, matchedCity }) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const handleChange = (val) => {
|
||||
const formatted = formatPhoneNumber(val);
|
||||
const checkedNum = validatePhoneNumber(formatted);
|
||||
const checkedNum = validatePhoneNumber(val);
|
||||
setError(checkedNum);
|
||||
setNum(formatted);
|
||||
setNum(val);
|
||||
};
|
||||
const handleReq = async () => {
|
||||
setLoading(true);
|
||||
request
|
||||
.sendCode(changeNumToDefault(num), "")
|
||||
.sendCode(num, "")
|
||||
.then((response) => {
|
||||
setLoading(false);
|
||||
if (response.uuid) {
|
||||
@@ -52,26 +47,7 @@ function LogInPage({ setIsSendMsg, num, setNum, setUuid, matchedCity }) {
|
||||
value={num}
|
||||
type="tel"
|
||||
error={!error.valid}
|
||||
spaceNull={true}
|
||||
inputProps={{
|
||||
startAdornment: (
|
||||
<InputAdornment
|
||||
className="!ml-4"
|
||||
position="start"
|
||||
sx={{
|
||||
".MuiTypography-root": {
|
||||
lineHeight: "0 !important",
|
||||
},
|
||||
".muirtl-1qj5e5k-MuiTypography-root": {
|
||||
color: "#000000de !important",
|
||||
},
|
||||
}}
|
||||
>
|
||||
09
|
||||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
title="شماره همراه"
|
||||
placeholder="09xxxxxxxxx"
|
||||
updateState={handleChange}
|
||||
/>
|
||||
<p
|
||||
|
||||
Reference in New Issue
Block a user