-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.tsx
45 lines (37 loc) · 1.3 KB
/
index.tsx
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
import * as React from 'react'
import * as ReactDOM from 'react-dom'
import { BrowserRouter as Router, Route, Link } from 'react-router-dom'
import './tachyons.css'
import './index.css'
import { simpleGraph } from './example-graphs/simpleGraph'
import { largeGraph } from './example-graphs/largeGraph'
import { GraphContainer } from './view/GraphContainer'
const linkStyling = 'link underline dim yellow'
const App = () => {
return (
<Router>
<div className="sans-serif">
<div className="bg-black white pa3">
<ul className="list f3">
<li><b>Simple:</b> <Link className={linkStyling} to="/graph/simple">Complete</Link></li>
<li><b>Large:</b> <Link className={linkStyling} to="/graph/large">Complete</Link></li>
</ul>
</div>
<div className="pa3">
<Route exact path="/graph/simple"
render={() => <GraphContainer initialGraph={simpleGraph} />}
/>
<Route exact path="/graph/large"
render={() => <GraphContainer initialGraph={largeGraph} />}
/>
</div>
</div>
</Router>
)
}
const container = document.getElementById('root')
const renderApp = () => ReactDOM.render(<App />, container)
renderApp()
/*if ((module as any).hot) {
(module as any).hot.accept(renderApp)
}*/