-
-
Notifications
You must be signed in to change notification settings - Fork 631
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #282 from lifeiscontent/feature/cleanup-react-comp…
…onents Feature/cleanup react components
- Loading branch information
Showing
14 changed files
with
76 additions
and
107 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
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
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
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
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,16 +1,12 @@ | ||
import React from 'react'; | ||
|
||
export default class RouterFirstPage extends React.Component { | ||
const RouterFirstPage = () => ( | ||
<div className="container"> | ||
<h2>React Router First Page</h2> | ||
<p> | ||
This page brought to you by React Router | ||
</p> | ||
</div> | ||
); | ||
|
||
render() { | ||
return ( | ||
<div className="container"> | ||
<h2>React Router First Page</h2> | ||
<p> | ||
This page brought to you by React Router | ||
</p> | ||
</div> | ||
); | ||
} | ||
|
||
} | ||
export default RouterFirstPage; |
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,39 +1,36 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router'; | ||
|
||
export default class RouterLayout extends React.Component { | ||
static propTypes = { | ||
children: React.PropTypes.object, | ||
}; | ||
const RouterLayout = ({ children }) => ( | ||
<div className="container"> | ||
<h1>React Router is working!</h1> | ||
<p> | ||
Woohoo, we can use <code>react-router</code> here! | ||
</p> | ||
<ul> | ||
<li> | ||
<Link to="/react_router"> | ||
React Router Layout Only | ||
</Link> | ||
</li> | ||
<li> | ||
<Link to="/react_router/first_page"> | ||
Router First Page | ||
</Link> | ||
</li> | ||
<li> | ||
<Link to="/react_router/second_page"> | ||
Router Second Page | ||
</Link> | ||
</li> | ||
</ul> | ||
<hr /> | ||
{children} | ||
</div> | ||
); | ||
|
||
render() { | ||
return ( | ||
<div className="container"> | ||
<h1>React Router is working!</h1> | ||
<p> | ||
Woohoo, we can use <code>react-router</code> here! | ||
</p> | ||
<ul> | ||
<li> | ||
<Link to="/react_router"> | ||
React Router Layout Only | ||
</Link> | ||
</li> | ||
<li> | ||
<Link to="/react_router/first_page"> | ||
Router First Page | ||
</Link> | ||
</li> | ||
<li> | ||
<Link to="/react_router/second_page"> | ||
Router Second Page | ||
</Link> | ||
</li> | ||
</ul> | ||
<hr /> | ||
{this.props.children} | ||
</div> | ||
); | ||
} | ||
RouterLayout.propTypes = { | ||
children: React.PropTypes.object, | ||
}; | ||
|
||
} | ||
export default RouterLayout; |
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,16 +1,12 @@ | ||
import React from 'react'; | ||
|
||
export default class RouterSecondPage extends React.Component { | ||
const RouterSecondPage = () => ( | ||
<div className="container"> | ||
<h2>React Router Second Page</h2> | ||
<p> | ||
This page brought to you by React Router | ||
</p> | ||
</div> | ||
); | ||
|
||
render() { | ||
return ( | ||
<div className="container"> | ||
<h2>React Router Second Page</h2> | ||
<p> | ||
This page brought to you by React Router | ||
</p> | ||
</div> | ||
); | ||
} | ||
|
||
} | ||
export default RouterSecondPage; |
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
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,12 +1,7 @@ | ||
import React from 'react'; | ||
import Router from 'react-router'; | ||
import createHistory from 'history/lib/createBrowserHistory'; | ||
import Router, { browserHistory } from 'react-router'; | ||
import routes from '../routes/routes'; | ||
|
||
export default (props) => { | ||
const history = createHistory(); | ||
|
||
return ( | ||
<Router history={history} children={routes} {...props} /> | ||
); | ||
}; | ||
export default (props) => ( | ||
<Router history={browserHistory} children={routes} {...props} /> | ||
); |
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
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
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
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
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