change name office-info && change name img uploaded && change theme selector && set default tab in appo page && clean code
This commit is contained in:
@@ -28,11 +28,11 @@ function Tabs({ value, handleChange, listTab, inactives, isSm, style }) {
|
||||
{...a11yProps(idx)}
|
||||
sx={{
|
||||
"&.MuiButtonBase-root": {
|
||||
width: !isSm && "fit-content !important",
|
||||
minWidth: !isSm && "fit-content !important",
|
||||
width: !isSm ? "fit-content !important" : undefined, // Fix: Replace `false` with `undefined`
|
||||
minWidth: !isSm ? "fit-content !important" : undefined,
|
||||
},
|
||||
"&.MuiButtonBase-root:first-child": {
|
||||
marginLeft: !isSm && "9px !important",
|
||||
marginLeft: !isSm ? "9px !important" : undefined,
|
||||
},
|
||||
}}
|
||||
className={`
|
||||
|
||||
@@ -3,16 +3,14 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import Hours from "./hours";
|
||||
import Tabs from "../../Tabs";
|
||||
import { Button } from "@mui/material";
|
||||
import ArrowLeftB from "@/components/icons/ArrowLeftB";
|
||||
import { request } from "@/services/response";
|
||||
import { useParams, useSearchParams } from "next/navigation";
|
||||
import { useParams } from "next/navigation";
|
||||
import SendAppo from "./SendAppo";
|
||||
|
||||
const listTab = ["صبح", "بعد از ظهر"];
|
||||
const nameHours = ["hours_morning", "hours_afternoon"];
|
||||
|
||||
function DateTime({ date, doctor, setStep, setIsError, locateVisit }) {
|
||||
function DateTime({ date, doctor }) {
|
||||
const params = useParams();
|
||||
const doctorId = params.doctorId;
|
||||
const [value, setValue] = useState(0);
|
||||
@@ -32,6 +30,9 @@ function DateTime({ date, doctor, setStep, setIsError, locateVisit }) {
|
||||
.getAppointment(doctorId, date)
|
||||
.then((res) => {
|
||||
setAppo(res);
|
||||
if (res.morning?.length && res.evening?.length) setValue(0);
|
||||
else if (res.morning?.length && value !== 0) setValue(0);
|
||||
else if (res.evening?.length && value !== 1) setValue(1);
|
||||
})
|
||||
.catch((err) => {
|
||||
setAppo("در حال حاضر، نوبتی برای ساعتهای صبح موجود نمیباشد.");
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import ListSubheader from "@mui/material/ListSubheader";
|
||||
import Select from "@mui/material/Select";
|
||||
import { useState } from "react";
|
||||
import { styleTextSelectRight } from "@/mui";
|
||||
import IconMultipleSelect from "@/components/icons/IconMultipleSelect";
|
||||
|
||||
|
||||
@@ -8,9 +8,10 @@ function Crop({ data, uploadImg, handleClose }) {
|
||||
const [zoom, setZoom] = useState(1);
|
||||
const [croppedAreaPixels, setCroppedAreaPixels] = useState(null);
|
||||
|
||||
const onComplete = async (imagePromise) => {
|
||||
const onComplete = async (imagePromise, name) => {
|
||||
const dataUrl = await imagePromise;
|
||||
const file = dataURLtoFile(dataUrl, "cropped-image.jpg");
|
||||
|
||||
const file = dataURLtoFile(dataUrl, name);
|
||||
|
||||
uploadImg({ blob: dataUrl, file });
|
||||
};
|
||||
@@ -22,7 +23,7 @@ function Crop({ data, uploadImg, handleClose }) {
|
||||
<Cropper
|
||||
crop={crop}
|
||||
zoom={zoom}
|
||||
aspect={4 / 3}
|
||||
aspect={1}
|
||||
image={data.blob}
|
||||
onCropChange={setCrop}
|
||||
onCropComplete={(_, croppedAreaPixels) =>
|
||||
@@ -42,7 +43,9 @@ function Crop({ data, uploadImg, handleClose }) {
|
||||
</Button>
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={() => onComplete(cropImage(data.blob, croppedAreaPixels))}
|
||||
onClick={() =>
|
||||
onComplete(cropImage(data.blob, croppedAreaPixels), data.file?.name)
|
||||
}
|
||||
className="!text-[16px] !max-w-[calc(50%_-_8px)] !font-medium !shadow-none !py-[5px] md:!py-[7px] lg:!py-[9px]"
|
||||
>
|
||||
ذخیره
|
||||
|
||||
Reference in New Issue
Block a user