File tree Expand file tree Collapse file tree 2 files changed +36
-4
lines changed Expand file tree Collapse file tree 2 files changed +36
-4
lines changed Original file line number Diff line number Diff line change @@ -143,5 +143,32 @@ main {
143
143
}
144
144
145
145
.preview-error {
146
- border : 1px solid red;
146
+ color : # be0924 ;
147
+ padding : 0.5rem 1.5rem ;
148
+ }
149
+
150
+ .preview-error pre {
151
+ color : # 111 ;
152
+ }
153
+
154
+ .compile-error {
155
+ color : # be0924 ;
156
+ position : fixed;
157
+ top : 3.4rem ;
158
+ background-color : white;
159
+ margin : 1.5rem ;
160
+ border : 1px solid # be0924 ;
161
+ padding : 0 0.5rem 0.5rem 0.5rem ;
162
+ border-radius : 4px ;
163
+ z-index : 4 ;
164
+ }
165
+
166
+ .compile-error pre {
167
+ color : # 111 ;
168
+ white-space : normal;
169
+ }
170
+
171
+ .with-error {
172
+ opacity : 0.8 ;
173
+ filter : blur (1.5px );
147
174
}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export function Preview(props) {
22
22
function ErrorFallback ( { error } ) {
23
23
return (
24
24
< div className = "preview-error" >
25
- < p > Something went wrong :</ p >
25
+ < h3 > Runtime Error :</ h3 >
26
26
< pre > { String ( error ) } </ pre >
27
27
</ div >
28
28
) ;
@@ -61,10 +61,15 @@ function InnerPreview({ input }) {
61
61
return (
62
62
< >
63
63
< style > { input . css } </ style >
64
- < div className = "preview-container" >
64
+ { error ? (
65
+ < div className = "compile-error" >
66
+ < h3 > Compliation Error:</ h3 >
67
+ < pre > { error } </ pre >
68
+ </ div >
69
+ ) : null }
70
+ < div className = { `preview-container ${ error ? "with-error" : "" } ` } >
65
71
{ Content ? < Content components = { { CH } } /> : null }
66
72
</ div >
67
- { error ? < div className = "preview-error" > { error } </ div > : null }
68
73
</ >
69
74
) ;
70
75
}
You can’t perform that action at this time.
0 commit comments