change name office-info && change name img uploaded && change theme selector && set default tab in appo page && clean code
This commit is contained in:
@@ -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