@@ -25,6 +25,7 @@ const Project = (props) => {
25
25
} = props ;
26
26
const saving = useSelector ( ( state ) => state . editor . saving ) ;
27
27
const autosave = useSelector ( ( state ) => state . editor . lastSaveAutosave ) ;
28
+ const project = useSelector ( ( state ) => state . editor . project ) ;
28
29
29
30
useEffect ( ( ) => {
30
31
if ( saving === "success" && autosave === false ) {
@@ -52,6 +53,8 @@ const Project = (props) => {
52
53
setLoading ( false ) ;
53
54
} , [ ] ) ;
54
55
56
+ const iframeSrc = "https://scratch-editor.pages.dev/" ;
57
+
55
58
return (
56
59
< div className = "proj" data-testid = "project" >
57
60
< div
@@ -64,18 +67,28 @@ const Project = (props) => {
64
67
{ withProjectbar && < ProjectBar nameEditable = { nameEditable } /> }
65
68
{ ! loading && (
66
69
< div className = "proj-editor-wrapper" >
67
- < ResizableWithHandle
68
- data-testid = "proj-editor-container"
69
- className = "proj-editor-container"
70
- defaultWidth = { defaultWidth }
71
- defaultHeight = { defaultHeight }
72
- handleDirection = { handleDirection }
73
- minWidth = "25%"
74
- maxWidth = { maxWidth }
75
- >
76
- < EditorInput />
77
- </ ResizableWithHandle >
78
- < Output />
70
+ { project . project_type === "scratch" ? (
71
+ < iframe
72
+ src = { iframeSrc }
73
+ style = { { width : "100%" , border : "0px" } }
74
+ title = "scratch"
75
+ > </ iframe >
76
+ ) : (
77
+ < >
78
+ < ResizableWithHandle
79
+ data-testid = "proj-editor-container"
80
+ className = "proj-editor-container"
81
+ defaultWidth = { defaultWidth }
82
+ defaultHeight = { defaultHeight }
83
+ handleDirection = { handleDirection }
84
+ minWidth = "25%"
85
+ maxWidth = { maxWidth }
86
+ >
87
+ < EditorInput />
88
+ </ ResizableWithHandle >
89
+ < Output />
90
+ </ >
91
+ ) }
79
92
</ div >
80
93
) }
81
94
</ div >
0 commit comments