Commit 6b56381 1 parent 11d6c69 commit 6b56381 Copy full SHA for 6b56381
File tree 1 file changed +44
-9
lines changed
1 file changed +44
-9
lines changed Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react' ;
2
2
import logo from './logo.svg' ;
3
+ import {
4
+ BrowserRouter as Router ,
5
+ Switch ,
6
+ Route ,
7
+ Link
8
+ } from "react-router-dom" ;
9
+ // import child components: search, customerlist, videolibrary
10
+
3
11
import './App.css' ;
4
12
13
+
5
14
class App extends Component {
6
15
render ( ) {
7
16
return (
8
- < div className = "App" >
9
- < header className = "App-header" >
10
- < img src = { logo } className = "App-logo" alt = "logo" />
11
- < h1 className = "App-title" > Welcome to React</ h1 >
12
- </ header >
13
- < p className = "App-intro" >
14
- To get started, edit < code > src/App.js</ code > and save to reload.
15
- </ p >
16
- </ div >
17
+ < Router >
18
+ < div >
19
+ < nav >
20
+ < ul >
21
+ < li >
22
+ < Link to = "/" > Home</ Link >
23
+ </ li >
24
+ < li >
25
+ < Link to = "/search" > Search</ Link >
26
+ </ li >
27
+ < li >
28
+ < Link to = "/customers" > Customers</ Link >
29
+ </ li >
30
+ < li >
31
+ < Link to = "/library" > Library</ Link >
32
+ </ li >
33
+ </ ul >
34
+ </ nav >
35
+
36
+ < Switch >
37
+ < Route path = "/search" >
38
+ < Search />
39
+ </ Route >
40
+ < Route path = "/customers" >
41
+ < CustomerList />
42
+ </ Route >
43
+ < Route path = "/library" >
44
+ < VideoLibrary />
45
+ </ Route >
46
+ < Route path = "/" >
47
+ < Home />
48
+ </ Route >
49
+ </ Switch >
50
+ </ div >
51
+ </ Router >
17
52
) ;
18
53
}
19
54
}
You can’t perform that action at this time.
0 commit comments