fix bug save and set data just with one key, remove page login from appo page, disable not avalaible data in calendar, change steps for pages in appo, get data user, edit and set in page user-info
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Button } from "@mui/material";
|
||||
import AddCircleBlueA from "@/components/icons/AddCircleBlueA";
|
||||
import ArrowLeftB from "@/components/icons/ArrowLeftB";
|
||||
import ButtonFixed from "../paying/ButtonFixed";
|
||||
import Form from "./Form";
|
||||
import { request } from "@/services/response";
|
||||
|
||||
function Detail({
|
||||
isForAnother,
|
||||
@@ -14,6 +15,7 @@ function Detail({
|
||||
fadeElement,
|
||||
setIsPay,
|
||||
}) {
|
||||
const [insurance, setInsurance] = useState();
|
||||
const [selected, setSelected] = useState({
|
||||
first: "",
|
||||
second: "",
|
||||
@@ -31,6 +33,19 @@ function Detail({
|
||||
const updateSelect = (event, name) =>
|
||||
setSelected({ ...selected, [name]: event });
|
||||
|
||||
const newStep = () => {
|
||||
// if(data)
|
||||
setStep((prev) => prev + 1);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
request.getInsuranceType().then((res) => {
|
||||
if (res && res.data) {
|
||||
setInsurance(res.data);
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
|
||||
return (
|
||||
// ${typePay === 'success' || typePay === 'failed' ? 'bg-transparent border-transparent md:bg-[#FFF] md:border-[#EFEFEF]' : ''}
|
||||
<div className="w-full lg:w-[59%]">
|
||||
@@ -43,10 +58,11 @@ function Detail({
|
||||
{isForAnother ? "اطلاعات کاربر جدید" : "اطلاعات حساب کاربری"}
|
||||
</p>
|
||||
<Form
|
||||
isForAnother={isForAnother}
|
||||
updateSelect={updateSelect}
|
||||
changeData={changeData}
|
||||
data={data}
|
||||
insurance={insurance}
|
||||
changeData={changeData}
|
||||
updateSelect={updateSelect}
|
||||
isForAnother={isForAnother}
|
||||
/>
|
||||
{!isForAnother && (
|
||||
<Button
|
||||
@@ -77,7 +93,7 @@ function Detail({
|
||||
: "!mt-0 md:!mt-[32px]"
|
||||
}`}
|
||||
variant="contained"
|
||||
onClick={() => setStep((prev) => prev + 1)}
|
||||
onClick={newStep}
|
||||
>
|
||||
<p className="text-[#EFEFEF] text-[16px] font-medium">
|
||||
ثبت اطلاعات
|
||||
|
||||
Reference in New Issue
Block a user