@@ -25,6 +25,7 @@ const Project = (props) => {
2525 } = props ;
2626 const saving = useSelector ( ( state ) => state . editor . saving ) ;
2727 const autosave = useSelector ( ( state ) => state . editor . lastSaveAutosave ) ;
28+ const project = useSelector ( ( state ) => state . editor . project ) ;
2829
2930 useEffect ( ( ) => {
3031 if ( saving === "success" && autosave === false ) {
@@ -52,6 +53,8 @@ const Project = (props) => {
5253 setLoading ( false ) ;
5354 } , [ ] ) ;
5455
56+ const iframeSrc = "https://scratch-editor.pages.dev/" ;
57+
5558 return (
5659 < div className = "proj" data-testid = "project" >
5760 < div
@@ -64,18 +67,28 @@ const Project = (props) => {
6467 { withProjectbar && < ProjectBar nameEditable = { nameEditable } /> }
6568 { ! loading && (
6669 < 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+ ) }
7992 </ div >
8093 ) }
8194 </ div >
0 commit comments