added initial capture popup UI, added ability to download capture
This commit is contained in:
@@ -75,14 +75,29 @@ const IdeCascadeStudio = ({ part, saveCode, loading }) => {
|
||||
onCapture={ async () => {
|
||||
// Get the canvas image as a Data URL
|
||||
const imgBlob = await CascadeController.capture(threejsViewport.environment)
|
||||
const imgURL = window.URL.createObjectURL(imgBlob)
|
||||
|
||||
// TODO: Upload the image to Cloudinary
|
||||
// uploadToCloudinary(imgBlob)
|
||||
// // Upload the image to Cloudinary
|
||||
// const cloudinaryImg = await uploadToCloudinary(imgBlob)
|
||||
|
||||
// TODO: Save the screenshot as the mainImage if none has been set
|
||||
// If it has been set, pass along the Blob without uploading
|
||||
// onSave(part?.id, { ...input, mainImage: cloudinaryPublicId })
|
||||
// // TODO: Save the screenshot as the mainImage if none has been set
|
||||
// // If it has been set, pass along the Blob without uploading
|
||||
// if (!part.mainImage) {
|
||||
// saveCode({
|
||||
// input: {
|
||||
// code,
|
||||
// title: part?.title,
|
||||
// userId: currentUser?.sub,
|
||||
// description: part?.description,
|
||||
// mainImage: cloudinaryImg.public_id,
|
||||
// },
|
||||
// id: part.id,
|
||||
// isFork: !canEdit,
|
||||
// })
|
||||
// } else {
|
||||
// console.log('not saving, passing back into IDE', cloudinaryImg)
|
||||
// }
|
||||
|
||||
return imgBlob
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user