Skip to content

Commit 6705df9

Browse files
update canvas loading state
1 parent d7bac52 commit 6705df9

2 files changed

Lines changed: 25 additions & 10 deletions

File tree

editor/components/app-runner/vanilla-app-runner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function VanillaRunner({
1010
source: string;
1111
componentName: string;
1212
}) {
13-
const inlinesource = source || `<p>Hello world</p>`;
13+
const inlinesource = source || `<div></div>`;
1414
return (
1515
<>
1616
<iframe

editor/scaffolds/editor/index.tsx

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ export function Editor() {
135135
<WorkspaceContentPanel>
136136
<>
137137
<EditorAppbarFragments.Canvas />
138-
{_key_for_preview && preview ? (
138+
{preview ? (
139139
<PreviewAndRunPanel
140-
key={_key_for_preview}
140+
// key={_key_for_preview}
141141
config={{
142142
src: preview.scaffold.raw,
143143
platform: preview_runner_framework.framework,
@@ -183,8 +183,8 @@ export function Editor() {
183183
},
184184
}
185185
: {
186-
"loading.txt": {
187-
raw: "// No input design provided to be converted..",
186+
loading: {
187+
raw: "Reading design...",
188188
language: "text",
189189
name: "loading",
190190
},
@@ -240,11 +240,26 @@ export function Editor() {
240240
);
241241
}
242242

243-
const EditorCanvasSkeleton = styled.div`
244-
width: 100%;
245-
height: 100%;
246-
color: red;
247-
`;
243+
const EditorCanvasSkeleton = () => {
244+
return (
245+
<PreviewAndRunPanel
246+
// key={_key_for_preview}
247+
config={{
248+
src: "",
249+
platform: "vanilla",
250+
componentName: "loading",
251+
sceneSize: {
252+
w: 375,
253+
h: 812,
254+
},
255+
initialMode: "run",
256+
fileid: "loading",
257+
sceneid: "loading",
258+
hideModeChangeControls: true,
259+
}}
260+
/>
261+
);
262+
};
248263

249264
const CodeEditorContainer = styled.div`
250265
display: flex;

0 commit comments

Comments
 (0)