removed debug remnants
parent
867e582342
commit
6b7fbe9ecf
|
@ -13,8 +13,6 @@ export default function ImageUploader({target, id, buttonMsg, handleAvatarChange
|
||||||
const [shownImage, setShownImage] = useState<string>();
|
const [shownImage, setShownImage] = useState<string>();
|
||||||
const [imageUploadModalOpen, setImageUploadModalOpen] = useState(false);
|
const [imageUploadModalOpen, setImageUploadModalOpen] = useState(false);
|
||||||
|
|
||||||
// TODO
|
|
||||||
// PUSH cropped image to the database in column = target
|
|
||||||
const openUploaderModal = () => {
|
const openUploaderModal = () => {
|
||||||
imageRef ? (setIsImageShown(true), setShownImage(imageRef)) : setIsImageShown(false);
|
imageRef ? (setIsImageShown(true), setShownImage(imageRef)) : setIsImageShown(false);
|
||||||
setImageUploadModalOpen(!imageUploadModalOpen)
|
setImageUploadModalOpen(!imageUploadModalOpen)
|
||||||
|
@ -25,9 +23,7 @@ export default function ImageUploader({target, id, buttonMsg, handleAvatarChange
|
||||||
};
|
};
|
||||||
|
|
||||||
async function ImageUploadHandler() {
|
async function ImageUploadHandler() {
|
||||||
console.log(imageFileRef.current.files[0]);
|
|
||||||
const img = await readFile(imageFileRef.current.files[0]);
|
const img = await readFile(imageFileRef.current.files[0]);
|
||||||
console.log(img);
|
|
||||||
setImageDataUrl(img);
|
setImageDataUrl(img);
|
||||||
CropHandler();
|
CropHandler();
|
||||||
}
|
}
|
||||||
|
@ -103,13 +99,6 @@ export default function ImageUploader({target, id, buttonMsg, handleAvatarChange
|
||||||
|
|
||||||
// As Base64 string
|
// As Base64 string
|
||||||
return canvas.toDataURL('image/jpeg');
|
return canvas.toDataURL('image/jpeg');
|
||||||
|
|
||||||
// As a blob
|
|
||||||
// return new Promise(resolve => {
|
|
||||||
// canvas.toBlob(file => {
|
|
||||||
// resolve(URL.createObjectURL(file))
|
|
||||||
// }, 'image/jpeg')
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue