Skip to content

Commit

Permalink
Examples: Remove display:none from CodeEditor and use actual componen…
Browse files Browse the repository at this point in the history
…t state to hide spinner (#5782)
  • Loading branch information
kungfooman committed Nov 7, 2023
1 parent f348546 commit 05421fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions examples/src/app/code-editor.mjs
Expand Up @@ -78,14 +78,12 @@ class CodeEditor extends TypedComponent {
/** @type {Record<string, string>} */
const files = event.files;
this.mergeState({ files, selectedFile: 'example.mjs' });
document.querySelector(".spin").style.display = 'none';
}

handleExampleLoading(event) {
this.mergeState({
files: {'example.mjs': '// reloading'}
});
document.querySelector(".spin").style.display = '';
}

handleRequestedFiles(event) {
Expand Down
4 changes: 2 additions & 2 deletions examples/src/app/example.mjs
Expand Up @@ -303,13 +303,13 @@ class Example extends TypedComponent {

render() {
const { iframePath } = this;
const { orientation } = this.state;
const { orientation, exampleLoaded } = this.state;
// console.log("Example#render", JSON.stringify(this.state, null, 2));
return jsx(Container,
{
id: "canvas-container"
},
jsx(Spinner, { size: 50 }),
!exampleLoaded && jsx(Spinner, { size: 50 }),
jsx("iframe", {
id: "exampleIframe",
key: iframePath,
Expand Down

0 comments on commit 05421fc

Please sign in to comment.