playground: better error display
This commit is contained in:
parent
532e371e7e
commit
75aebd9156
|
@ -23,7 +23,7 @@ jobs:
|
|||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: wasm32-unknown-unknown
|
||||
targets: wasm32-unknown-unknown
|
||||
- name: Install wasm-bindgen-cli
|
||||
uses: jetli/wasm-bindgen-action@v0.2.0
|
||||
- name: Install, build, and upload your site output
|
||||
|
|
|
@ -18,25 +18,16 @@ export default function ErrorDisplay({
|
|||
<Dialog open={error !== null} onClose={() => setError(null)}>
|
||||
<DialogTitle>{lang.title}</DialogTitle>
|
||||
<DialogContent>
|
||||
<div
|
||||
style={{
|
||||
backgroundColor: "black",
|
||||
padding: "15px",
|
||||
borderRadius: "15px",
|
||||
fontSize: "1.2em",
|
||||
}}
|
||||
>
|
||||
<div className="error-terminal-display">
|
||||
<code
|
||||
style={{
|
||||
whiteSpace: "break-spaces",
|
||||
fontFamily: "monospace",
|
||||
}}
|
||||
dangerouslySetInnerHTML={{ __html: error ?? "" }}
|
||||
></code>
|
||||
</div>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setError(null)}>{lang.buttons.close}</Button>
|
||||
<Button onClick={() => setError(null)}>
|
||||
{lang.buttons.close}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
);
|
||||
|
|
|
@ -42,4 +42,31 @@
|
|||
> .editor {
|
||||
grid-area: editor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.error-terminal-display {
|
||||
background-color: black;
|
||||
padding: 15px;
|
||||
border-radius: 15px;
|
||||
font-size: 1.2em;
|
||||
line-height: 0.8em;
|
||||
|
||||
--red: #ff0000;
|
||||
--cyan: #00d6d6;
|
||||
|
||||
code {
|
||||
white-space: break-spaces;
|
||||
font-family: monospace;
|
||||
}
|
||||
}
|
||||
|
||||
:root[data-theme="light"] {
|
||||
.error-terminal-display {
|
||||
background-color: lightgray;
|
||||
|
||||
--red: #ff3f3f;
|
||||
--cyan: #00a6a6;
|
||||
--black: lightgray;
|
||||
--white: #4f4f4f;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue