2015-06-18 04:04:28 +00:00
|
|
|
import React, { PropTypes } from 'react';
|
2015-07-25 00:52:07 +00:00
|
|
|
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';
|
2015-06-18 04:04:28 +00:00
|
|
|
|
2015-07-25 00:52:07 +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
|
|
|
|
2015-07-25 00:52:07 +00:00
|
|
|
propTypes: {
|
2015-07-25 04:54:19 +00:00
|
|
|
children: PropTypes.node,
|
|
|
|
points: PropTypes.number,
|
2015-07-29 17:16:48 +00:00
|
|
|
picture: PropTypes.string,
|
|
|
|
title: PropTypes.string,
|
|
|
|
username: PropTypes.string
|
|
|
|
},
|
|
|
|
|
2015-07-25 00:52:07 +00:00
|
|
|
render() {
|
2015-07-25 04:54:19 +00:00
|
|
|
const { username, points, picture } = this.props;
|
|
|
|
const navProps = { username, points, picture };
|
2015-07-25 00:52:07 +00:00
|
|
|
return (
|
|
|
|
<div>
|
2015-07-25 04:54:19 +00:00
|
|
|
<Nav
|
|
|
|
{ ...navProps }/>
|
2015-07-25 00:52:07 +00:00
|
|
|
<Row>
|
|
|
|
{ this.props.children }
|
|
|
|
</Row>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
);
|