-
Notifications
You must be signed in to change notification settings - Fork 20
/
App.js
66 lines (59 loc) · 2.12 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import React, { Component } from 'react';
import { BrowserRouter, Link, Route, Switch } from 'react-router-dom';
import { ModalContainer } from 'react-router-modal';
import BasicExample from './examples/basic';
import ChildrenExample from './examples/children';
import ModalLinkExample from './examples/modal_link';
import MatchParamsExample from './examples/match_params';
import Home from './home';
import NotFound from './not_found';
import './App.css';
import 'react-router-modal/css/react-router-modal.css';
class App extends Component {
render() {
const url = `/react-router-modal-examples`;
return (
<div>
<BrowserRouter>
<div className="App">
<div className="App-header">
<h2>react-router-modal</h2>
<h5>Example Usage</h5>
</div>
<div className="App-main">
<div className="App-nav">
<h3>Examples</h3>
<ul>
<li>
<Link to={`${url}/basic`}>Basic</Link>
</li>
<li>
<Link to={`${url}/children`}>Children</Link>
</li>
<li>
<Link to={`${url}/modal_link`}>ModalLink</Link>
</li>
<li>
<Link to={`${url}/match_params`}>Using match.params</Link>
</li>
</ul>
</div>
<div className="App-content">
<Switch>
<Route path={`${url}/basic`} component={BasicExample} />
<Route path={`${url}/children`} component={ChildrenExample} />
<Route path={`${url}/modal_link`} component={ModalLinkExample} />
<Route path={`${url}/match_params`} component={MatchParamsExample} />
<Route path={url} component={Home} exact/>
<Route path='*' component={NotFound} />
</Switch>
</div>
</div>
<ModalContainer />
</div>
</BrowserRouter>
</div>
);
}
}
export default App;