Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jonathan Jalouzot
committed
Jul 3, 2016
1 parent
2e1f269
commit fa7bb80
Showing
17 changed files
with
26,189 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import React from 'react' | ||
import { render } from 'react-dom' | ||
import App from './modules/App' | ||
import { Router, browserHistory } from 'react-router' | ||
// import routes and pass them into <Router/> | ||
import routes from './modules/routes' | ||
|
||
render(<App/>, document.getElementById('app')) | ||
render( | ||
<Router routes={routes} history={browserHistory}/>, | ||
document.getElementById('app') | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react' | ||
|
||
export default React.createClass({ | ||
render() { | ||
return <div>About</div> | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
import { Link } from 'react-router' | ||
import React from 'react' | ||
import NavLink from './NavLink' | ||
import Home from './Home' | ||
import { IndexLink } from 'react-router' | ||
|
||
|
||
export default React.createClass({ | ||
render() { | ||
return <div>Hello, React2 3 Router!</div> | ||
return ( | ||
<div> | ||
<h1>Ghettohub Issues</h1> | ||
<ul role="nav"> | ||
<li><NavLink to="/" onlyActiveOnIndex={true}>Home</NavLink></li> | ||
<li><NavLink to="/about">About</NavLink></li> | ||
<li><NavLink to="/repos">Repos</NavLink></li> | ||
</ul> | ||
|
||
{/* add this */} | ||
{this.props.children || <Home/>} | ||
|
||
</div> | ||
) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react' | ||
|
||
export default React.createClass({ | ||
render() { | ||
return <div>Home</div> | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react' | ||
import { Link } from 'react-router' | ||
|
||
export default React.createClass({ | ||
render() { | ||
return <Link {...this.props} activeClassName="active"/> | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react' | ||
|
||
export default React.createClass({ | ||
render() { | ||
return ( | ||
<div> | ||
<h2>{this.props.params.repoName}</h2> | ||
</div> | ||
) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react' | ||
import NavLink from './NavLink' | ||
import { Link } from 'react-router' | ||
|
||
export default React.createClass({ | ||
render() { | ||
return ( | ||
<div> | ||
<h2>Repos</h2> | ||
|
||
{/* add some links */} | ||
<ul> | ||
<li><NavLink to="/repos/reactjs/react-router">React Router</NavLink></li> | ||
<li><NavLink to="/repos/facebook/react">React</NavLink></li> | ||
</ul> | ||
|
||
{this.props.children} | ||
</div> | ||
) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react' | ||
import { Route, IndexRoute } from 'react-router' | ||
import App from './App' | ||
import About from './About' | ||
import Repos from './Repos' | ||
import Repo from './Repo' | ||
import Home from './Home' | ||
|
||
module.exports = ( | ||
<Route path="/" component={App}> | ||
<IndexRoute component={Home}/> | ||
<Route path="/repos" component={Repos}> | ||
<Route path="/repos/:userName/:repoName" component={Repo}/> | ||
</Route> | ||
<Route path="/about" component={About}/> | ||
</Route> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.active { | ||
color: green; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.