File tree Expand file tree Collapse file tree 6 files changed +50
-13
lines changed Expand file tree Collapse file tree 6 files changed +50
-13
lines changed Original file line number Diff line number Diff line change @@ -23,19 +23,21 @@ const theme = createTheme({
23
23
24
24
function App ( ) {
25
25
return (
26
+ < div className = { styles . root } >
26
27
< div className = { styles . App } >
27
28
< ThemeProvider theme = { theme } >
28
29
< NavigationBar />
29
30
< Switch >
30
31
< Route path = "/" component = { HomePage } exact />
31
- < Route path = "/page1 " component = { PageOne } />
32
- < Route path = "/page2 " component = { PageTwo } />
32
+ < Route path = "/problem " component = { PageOne } />
33
+ < Route path = "/vfg " component = { PageTwo } />
33
34
< Route path = "/page3" component = { PageThree } />
34
- < Route path = "/page4 " component = { PageFour } />
35
+ < Route path = "/demo " component = { PageFour } />
35
36
</ Switch >
36
37
</ ThemeProvider >
37
38
{ /* <div>this is app</div> */ }
38
39
</ div >
40
+ </ div >
39
41
) ;
40
42
}
41
43
Original file line number Diff line number Diff line change
1
+ .root {
2
+ position : absolute ;
3
+ top : 0 ;
4
+ left : 0 ;
5
+ right : 0 ;
6
+ bottom : 0 ;
7
+ background-color : #ffffff ;
8
+
9
+ }
1
10
.App {
2
11
text-align : center ;
3
12
display : flex ;
4
13
flex-direction : column ;
5
14
align-items : center ;
6
15
justify-content : center ;
16
+
7
17
}
8
18
Original file line number Diff line number Diff line change @@ -28,14 +28,18 @@ const useStyles = makeStyles((theme) => ({
28
28
link : {
29
29
margin : theme . spacing ( 1 , 1.5 ) ,
30
30
cursor : 'pointer'
31
+ } ,
32
+ alink : {
33
+ color : '#ffffff' ,
34
+ textDecoration : 'none'
31
35
}
32
36
} ) ) ;
33
37
34
38
const nav = {
35
- problem : '/page1 ' ,
36
- vfg : '/page2 ' ,
37
- manual : '/page3 ' ,
38
- demo : '/page4 ' ,
39
+ problem : '/problem ' ,
40
+ vfg : '/vfg ' ,
41
+ manual : 'https://planimation.github.io/documentation/ ' ,
42
+ demo : '/demo ' ,
39
43
home : '/'
40
44
} ;
41
45
@@ -46,7 +50,12 @@ function NavigationBar() {
46
50
47
51
const handleClick = ( url ) => {
48
52
setUrl ( url ) ;
49
- history . push ( nav [ url ] ) ;
53
+ if ( url === 'manual' ) {
54
+ window . location . href ( nav [ url ] )
55
+ } else {
56
+ history . push ( nav [ url ] ) ;
57
+
58
+ }
50
59
}
51
60
52
61
return (
@@ -62,8 +71,8 @@ function NavigationBar() {
62
71
< Link variant = "button" color = "inherit" onClick = { ( ) => handleClick ( 'vfg' ) } className = { classes . link } >
63
72
VFG
64
73
</ Link >
65
- < Link variant = "button" color = "inherit" onClick = { ( ) => handleClick ( 'manual' ) } className = { classes . link } >
66
- User Manual
74
+ < Link variant = "button" color = "inherit" className = { classes . link } >
75
+ < a href = { 'https://planimation.github.io/documentation/' } target = '_blank' rel = "noreferrer" className = { classes . alink } > User Manual</ a >
67
76
</ Link >
68
77
< Link variant = "button" color = "inherit" onClick = { ( ) => handleClick ( 'demo' ) } className = { classes . link } >
69
78
Demo
Original file line number Diff line number Diff line change @@ -139,7 +139,23 @@ export default function Home() {
139
139
140
140
const handleOnClick = ( num ) => {
141
141
setNum ( num + 1 ) ;
142
- history . push ( '/page' + num ) ;
142
+ switch ( num ) {
143
+ case 1 :
144
+ history . push ( '/problem' ) ;
145
+ break ;
146
+ case 2 :
147
+ history . push ( '/vfg' ) ;
148
+ break ;
149
+ case 3 :
150
+ window . open ( 'https://planimation.github.io/documentation/' )
151
+ break ;
152
+ case 4 :
153
+ history . push ( '/demo' ) ;
154
+ break ;
155
+ default : return ;
156
+ }
157
+
158
+
143
159
}
144
160
145
161
return (
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ class PageOne extends React.Component {
49
49
50
50
handleStore = ( content ) => {
51
51
localStorage . setItem ( 'fileContent' , content ) ;
52
- window . location . href = '/page4 ' ;
52
+ window . location . href = '/demo ' ;
53
53
}
54
54
55
55
handleNewURL = ( urlString ) => {
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ class PageTwo extends React.Component {
172
172
< Button variant = "contained" color = "default" onClick = { this . handleOnClick } text-align = "left" > Cancel</ Button >
173
173
< Button variant = "contained" color = "primary" startIcon = { < CloudUploadIcon /> } onClick = { ( ) => {
174
174
// eslint-disable-next-line no-restricted-globals
175
- location . href = '/page4 ' ;
175
+ location . href = '/demo ' ;
176
176
} } text-align = "right" > Continue</ Button >
177
177
</ div >
178
178
</ Container >
You can’t perform that action at this time.
0 commit comments