freeCodeCamp/common/app/App.jsx

44 lines
936 B
React
Raw Normal View History

2015-06-18 04:04:28 +00:00
import React, { PropTypes } from 'react';
import { contain } from 'thundercats-react';
2015-07-04 15:16:42 +00:00
import { Row } from 'react-bootstrap';
2015-06-18 04:04:28 +00:00
2015-07-04 00:46:58 +00:00
import { Nav } from './components/Nav';
import { Footer } from './components/Footer';
2015-06-18 04:04:28 +00:00
export default contain(
{
store: 'appStore',
fetchAction: 'appActions.getUser',
getPayload(props) {
return {
isPrimed: !!props.username
};
}
},
React.createClass({
displayName: 'FreeCodeCamp',
2015-06-18 04:04:28 +00:00
propTypes: {
2015-07-25 04:54:19 +00:00
children: PropTypes.node,
username: PropTypes.string,
points: PropTypes.number,
picture: PropTypes.string
},
2015-06-18 04:04:28 +00:00
render() {
2015-07-25 04:54:19 +00:00
const { username, points, picture } = this.props;
const navProps = { username, points, picture };
return (
<div>
2015-07-25 04:54:19 +00:00
<Nav
{ ...navProps }/>
<Row>
{ this.props.children }
</Row>
<Footer />
</div>
);
}
})
);