1- import  Button  from  "evergreen-ui/commonjs/buttons/src/Button.js" ; 
21import  Heading  from  "evergreen-ui/commonjs/typography/src/Heading.js" ; 
32import  Code  from  "evergreen-ui/commonjs/typography/src/Code.js" ; 
43import  SegmentedControl  from  "evergreen-ui/commonjs/segmented-control/src/SegmentedControl.js" ; 
54import  Alert  from  "evergreen-ui/commonjs/alert/src/Alert.js" ; 
65import  Spinner  from  "evergreen-ui/commonjs/spinner/src/Spinner.js" ; 
7- import  Icon  from  "evergreen-ui/commonjs/icon/src/Icon.js" ; 
86import  Pane  from  "evergreen-ui/commonjs/layers/src/Pane.js" ; 
97import  *  as  React  from  "react" ; 
108import  {  IState ,  Method ,  fontInput  }  from  "./common" ; 
119import  TextInput  from  "./form/TextInput" ; 
1210import  Theme  from  "./theme" ; 
13- // import * as theme from 'evergreen-ui/commonjs/theme' 
1411import  Store  from  "./store" ; 
1512import  {  RRegExp  }  from  "./rregex" ; 
1613import  ViewMatch  from  "./rust/ViewMatch" ; 
1714import  ViewReplace  from  "./rust/ViewReplace" ; 
1815import  ViewSyntax  from  "./rust/ViewSyntax" ; 
19- import  GithubCircle  from  "./icon/GithubCircle" ; 
2016import  Documentation  from  "./rust/Documentation" ; 
2117import  TopBar  from  "./layout/TopBar" ; 
2218import  MenuItem  from  "./layout/MenuItem" ; 
@@ -171,18 +167,7 @@ export default function App({ store }: IAppProps) {
171167            minRows = { store . value . method  ===  Method . syntax  ? 10  : 1 } 
172168            onChange = { handleChangeProp ( "regex" ) } 
173169            value = { store . value . regex } 
174-             marginBottom = { result . regexExpressionError  &&  ".5rem" } 
175170          /> 
176-           { result . regexExpressionError  &&  ( 
177-             < Code 
178-               size = { 300 } 
179-               appearance = "minimal" 
180-               style = { {  whiteSpace : "pre" ,  color : theme . colors . text . danger  } } 
181-             > 
182-               < Icon  icon = "error"  color = "danger"  size = { 12 }  /> { " " } 
183-               { result . regexExpressionError . message } 
184-             </ Code > 
185-           ) } 
186171        </ Pane > 
187172        { store . value . method  ===  Method . replace  &&  ( 
188173          < Pane  marginBottom = "1rem" > 
@@ -238,8 +223,25 @@ export default function App({ store }: IAppProps) {
238223          </ Pane > 
239224        ) } 
240225
226+         { completed  &&  rregex  &&  result . regexExpressionError  &&  ( 
227+           < Pane  width = "100%"  padding = "2rem" > 
228+             < Alert  intent = "danger"  title = "regex parse error:" > 
229+               < Code 
230+                 size = { 300 } 
231+                 appearance = "minimal" 
232+                 style = { {  whiteSpace : "pre" ,  color : theme . colors . text . danger  } } 
233+               > 
234+                 { result . regexExpressionError . message . slice ( 
235+                   result . regexExpressionError . message . indexOf ( "\n" ) 
236+                 ) } 
237+               </ Code > 
238+             </ Alert > 
239+           </ Pane > 
240+         ) } 
241+ 
241242        { completed  && 
242243          rregex  && 
244+           ! result . regexExpressionError  && 
243245          ( store . value . method  ===  Method . find  &&  ( 
244246            < ViewMatch 
245247              size = ".75rem" 
@@ -252,6 +254,7 @@ export default function App({ store }: IAppProps) {
252254
253255        { completed  && 
254256          rregex  && 
257+           ! result . regexExpressionError  && 
255258          ( store . value . method  ===  Method . replace  &&  ( 
256259            < ViewReplace 
257260              size = ".75rem" 
0 commit comments