Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Commit 2a99c56

Browse files
committed
Add some shiz
1 parent f4516e3 commit 2a99c56

File tree

4 files changed

+38
-2
lines changed

4 files changed

+38
-2
lines changed

lessons/01-setting-up/index.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
import React from 'react'
22
import { render } from 'react-dom'
33
import App from './modules/App'
4-
render(<App/>, document.getElementById('app'))
4+
import { Router, Route, hashHistory } from 'react-router'
5+
import About from './modules/About'
6+
import Repos from './modules/Repos'
7+
8+
9+
render((
10+
<Router history={hashHistory}>
11+
<Route path="/" component={App}>
12+
<Route path="/repos" component={Repos} />
13+
<Route path="/about" component={About} />
14+
</Route>
15+
</Router>
16+
), document.getElementById('app'))
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react'
2+
3+
export default React.createClass({
4+
render() {
5+
return <div>About</div>
6+
}
7+
})
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
import React from 'react'
2+
import { Link } from 'react-router';
23

34
export default React.createClass({
45
render() {
5-
return <div>Hello, React Router!</div>
6+
return (
7+
<div>
8+
<h1>Ghetto hub issues</h1>
9+
<ul role="nav">
10+
<li><Link to='/about' activeStyle={{ color:'#c9ce06' }}>About</Link></li>
11+
<li><Link to='/repos' activeStyle={{ color:'chartreuse' }}>Repos</Link></li>
12+
</ul>
13+
{this.props.children}
14+
</div>
15+
)
616
}
717
})
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react'
2+
3+
export default React.createClass({
4+
render() {
5+
return <div>Repos</div>
6+
}
7+
})

0 commit comments

Comments
 (0)