remove additional code && fix bug select city and state && alert success and error message for comment in doctors page && handle set data after user searched in field doctors page && set data appointment from doctor data && set value in field search after user reload in doctors page
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { alert, isUserLoggedIn } from "@/helper";
|
||||
import { Button } from "@mui/material";
|
||||
import React from "react";
|
||||
|
||||
function BtnNewComment({ handleOpen }) {
|
||||
const handleClick = () => {
|
||||
if (isUserLoggedIn()) {
|
||||
handleOpen();
|
||||
} else {
|
||||
alert("warning", "برای ارسال کامنت باید ابتدا وارد حساب کاربری شوید.");
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Button
|
||||
variant="outlined"
|
||||
onClick={handleClick}
|
||||
className="!py-[6px] md:!py-2 lg:!py-[9px] !px-[16px] sm:!px-[23px] md:!px-[29px]
|
||||
lg:!px-[36px] !mr-0 md:!mr-4 !rounded !w-full md:!w-fit"
|
||||
>
|
||||
ثبت نظر
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
||||
export default BtnNewComment;
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import { styleDefault } from "@/mui";
|
||||
import { Box, Button, Modal, Rating, Slider } from "@mui/material";
|
||||
import { Box, Button, Modal, Rating } from "@mui/material";
|
||||
import CloseModalD from "@/components/icons/CloseModalD";
|
||||
import Field from "@/app/component/fields/Field";
|
||||
import ArrowLeftD from "@/components/icons/ArrowLeftD";
|
||||
import ProgressChange from "@/app/component/ProgressChange";
|
||||
import ProgressDetail from "@/data/progress_detail.json";
|
||||
import Link from "next/link";
|
||||
import { request } from "@/services/response";
|
||||
import BtnNewComment from "./BtnNewComment";
|
||||
|
||||
function ModalAnswer({ doctor }) {
|
||||
const [open, setOpen] = useState(false);
|
||||
@@ -81,14 +81,7 @@ function ModalAnswer({ doctor }) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
variant="outlined"
|
||||
onClick={handleOpen}
|
||||
className="!py-[6px] md:!py-2 lg:!py-[9px] !px-[16px] sm:!px-[23px] md:!px-[29px]
|
||||
lg:!px-[36px] !mr-0 md:!mr-4 !rounded !w-full md:!w-fit"
|
||||
>
|
||||
ثبت نظر
|
||||
</Button>
|
||||
<BtnNewComment handleOpen={handleOpen} />
|
||||
<Modal open={open} onClose={handleClose}>
|
||||
<Box
|
||||
sx={styleDefault}
|
||||
|
||||
Reference in New Issue
Block a user