diff --git a/app/web/src/components/EditableProjecTitle/EditableProjecTitle.tsx b/app/web/src/components/EditableProjecTitle/EditableProjecTitle.tsx
index fdb7102..ccc0333 100644
--- a/app/web/src/components/EditableProjecTitle/EditableProjecTitle.tsx
+++ b/app/web/src/components/EditableProjecTitle/EditableProjecTitle.tsx
@@ -76,10 +76,12 @@ const EditableProjectTitle = ({
value={newTitle}
onChange={onTitleChange}
ref={inputRef}
- onBlur={() => setTimeout(() => {
- setInEditMode(false)
- setNewTitle(projectTitle)
- }, 300)}
+ onBlur={() =>
+ setTimeout(() => {
+ setInEditMode(false)
+ setNewTitle(projectTitle)
+ }, 300)
+ }
/>
diff --git a/app/web/src/components/IdeHeader/IdeHeader.tsx b/app/web/src/components/IdeHeader/IdeHeader.tsx
index bd61ea6..0b077b8 100644
--- a/app/web/src/components/IdeHeader/IdeHeader.tsx
+++ b/app/web/src/components/IdeHeader/IdeHeader.tsx
@@ -95,6 +95,8 @@ const IdeHeader = ({
{canEdit && !projectTitle && (
(
setComment(target.value)}
+ onChange={({ target }) =>
+ setComment(target.value)
+ }
/>
)}
- {project?.Comment.map(({ text, user, id, createdAt }) => (
- -
-
-
-
- {user?.userName}
-
-
- {new Date(createdAt).toDateString()}
+ {project?.Comment.map(
+ ({ text, user, id, createdAt }) => (
+
-
+
+
+
+ {user?.userName}
+
+
+ {new Date(createdAt).toDateString()}
+
-
-
- {text}
-
-
- ))}
+
+ {text}
+
+
+ )
+ )}
>
)}
diff --git a/app/web/src/helpers/canvasToBlob.ts b/app/web/src/helpers/canvasToBlob.ts
new file mode 100644
index 0000000..27a6d8e
--- /dev/null
+++ b/app/web/src/helpers/canvasToBlob.ts
@@ -0,0 +1,35 @@
+export const canvasToBlob = async (
+ threeInstance,
+ { width, height }: { width: number; height: number }
+): Promise
=> {
+ const updateCanvasSize = ({
+ width,
+ height,
+ }: {
+ width: number
+ height: number
+ }) => {
+ threeInstance.camera.aspect = width / height
+ threeInstance.camera.updateProjectionMatrix()
+ threeInstance.gl.setSize(width, height)
+ threeInstance.gl.render(
+ threeInstance.scene,
+ threeInstance.camera,
+ null,
+ false
+ )
+ }
+ const oldSize = threeInstance.size
+ updateCanvasSize({ width, height })
+ const imgBlobPromise: Promise = new Promise((resolve, reject) => {
+ threeInstance.gl.domElement.toBlob(
+ (blob) => {
+ resolve(blob)
+ },
+ 'image/jpeg',
+ 1
+ )
+ })
+ updateCanvasSize(oldSize)
+ return imgBlobPromise
+}