File tree Expand file tree Collapse file tree 2 files changed +35
-10
lines changed Expand file tree Collapse file tree 2 files changed +35
-10
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import {
11
11
import { useStoreContext } from '../store' ;
12
12
13
13
function MainContainer ( ) {
14
- const [ npmExists , setnpm ] = useState ( false ) ;
15
14
const [ store , dispatch ] = useStoreContext ( ) ;
16
15
const { tabs, currentTab, port : currentPort } = store ;
17
16
@@ -39,7 +38,6 @@ function MainContainer() {
39
38
}
40
39
case 'initialConnectSnapshots' : {
41
40
dispatch ( initialConnect ( payload ) ) ;
42
- setnpm ( true ) ;
43
41
break ;
44
42
}
45
43
default :
@@ -54,7 +52,19 @@ function MainContainer() {
54
52
dispatch ( setPort ( port ) ) ;
55
53
} ) ;
56
54
57
- if ( ! npmExists ) return < div style = { { color : 'black' } } > Please install our npm package in your app</ div > ;
55
+ if ( ! tabs [ currentTab ] ) {
56
+ return (
57
+ < div className = "error-container" >
58
+ < a
59
+ href = "https://www.npmjs.com/package/react-time-travel"
60
+ target = "_blank"
61
+ rel = "noopener noreferrer"
62
+ >
63
+ No React application found. Please install our npm package in your app.
64
+ </ a >
65
+ </ div >
66
+ ) ;
67
+ }
58
68
const { viewIndex, sliderIndex, snapshots } = tabs [ currentTab ] ;
59
69
60
70
// if viewIndex is -1, then use the sliderIndex instead
Original file line number Diff line number Diff line change @@ -18,15 +18,30 @@ body {
18
18
overflow : hidden ;
19
19
}
20
20
21
+ .error-container {
22
+ height : 100% ;
23
+ margin : 0 auto ;
24
+ background-color : $brand-color ;
25
+ overflow : hidden ;
26
+
27
+ display : grid ;
28
+ justify-content : center ;
29
+ a {
30
+ color : white ;
31
+ margin-top : 5% ;
32
+ height : 3% ;
33
+ }
34
+ }
35
+
21
36
.body-container {
22
37
height : 94% ;
23
38
display : grid ;
24
39
grid-template-columns : 1fr 2fr ;
25
40
grid-template-rows : 8fr 1fr ;
26
41
grid-template-areas :
27
- " actions states"
28
- " travel travel"
29
- " buttons buttons" ;
42
+ ' actions states'
43
+ ' travel travel'
44
+ ' buttons buttons' ;
30
45
}
31
46
32
47
/* if extension width is less than 500px, stack the body containers */
@@ -35,10 +50,10 @@ body {
35
50
grid-template-rows : 3fr 5fr 1fr ;
36
51
grid-template-columns : auto ;
37
52
grid-template-areas :
38
- " actions"
39
- " states"
40
- " travel"
41
- " buttons" ;
53
+ ' actions'
54
+ ' states'
55
+ ' travel'
56
+ ' buttons' ;
42
57
}
43
58
}
44
59
.travel-container {
You can’t perform that action at this time.
0 commit comments