-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Router functionality * Custom active class - thanks to @spicyj - remix-run/react-router#86 * Update deps * Namespace CSS * Remove learn modules
- Loading branch information
1 parent
9a6f0bf
commit 54e7033
Showing
12 changed files
with
175 additions
and
154 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
var React = require('react'); | ||
var Router = require('react-router'); | ||
var Link = Router.Link; | ||
var RouteHandler = Router.RouteHandler; | ||
|
||
var CustomLink = React.createClass({ | ||
getDefaultProps: function () { | ||
return { activeClassName: 'p-active' }; | ||
}, | ||
render: function () { | ||
return <Link {...this.props}>{this.props.children}</Link>; | ||
} | ||
}); | ||
|
||
var App = React.createClass({ | ||
render: function () { | ||
return ( | ||
<div> | ||
<header className="p-header"> | ||
<h1>SIS Team Members</h1> | ||
</header> | ||
<ul className="p-navigation"> | ||
<li><CustomLink to="game">Game</CustomLink></li> | ||
<li><CustomLink to="overview">Overview</CustomLink></li> | ||
</ul> | ||
|
||
<div className="p-container"> | ||
<RouteHandler/> | ||
</div> | ||
</div> | ||
); | ||
} | ||
}); | ||
|
||
module.exports = 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
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,3 +1 @@ | ||
require('./render.jsx'); | ||
|
||
// require('./learn-es6') |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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,31 @@ | ||
var React = require('react'); | ||
var Picture = require('./picture.jsx'); | ||
var $ = require('jquery'); | ||
|
||
var Overview = React.createClass({ | ||
getInitialState() { | ||
return { | ||
pictures: [] | ||
}; | ||
}, | ||
componentDidMount() { | ||
let url = 'https://sisteam.herokuapp.com/api/pictures'; | ||
$.get(url, function(result) { | ||
if (this.isMounted()) { | ||
this.setState({ | ||
pictures: result.pictures | ||
}); | ||
} | ||
}.bind(this)); | ||
}, | ||
render() { | ||
return ( | ||
<ul className="p-pictures-container"> | ||
{this.state.pictures.map(function(picture) { | ||
return <Picture key={picture.image} data={picture}/>; | ||
})} | ||
</ul> | ||
); | ||
} | ||
}); | ||
module.exports = Overview; |
Oops, something went wrong.