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 {
143143}
144144
145145.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 );
147174}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export function Preview(props) {
2222function ErrorFallback ( { error } ) {
2323 return (
2424 < div className = "preview-error" >
25- < p > Something went wrong :</ p >
25+ < h3 > Runtime Error :</ h3 >
2626 < pre > { String ( error ) } </ pre >
2727 </ div >
2828 ) ;
@@ -61,10 +61,15 @@ function InnerPreview({ input }) {
6161 return (
6262 < >
6363 < 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" : "" } ` } >
6571 { Content ? < Content components = { { CH } } /> : null }
6672 </ div >
67- { error ? < div className = "preview-error" > { error } </ div > : null }
6873 </ >
6974 ) ;
7075}
You can’t perform that action at this time.
0 commit comments