11import React , { PropTypes } from 'react'
22import { connect } from 'react-redux'
3- import { EDIT_MODE , IDLE_MODE , NEW , toggleTutorial } from 'boost/actions'
4- // import UserNavigator from './HomePage/UserNavigator'
3+ import { EDIT_MODE , IDLE_MODE , toggleTutorial } from 'boost/actions'
54import ArticleNavigator from './HomePage/ArticleNavigator'
65import ArticleTopBar from './HomePage/ArticleTopBar'
76import ArticleList from './HomePage/ArticleList'
@@ -114,13 +113,14 @@ class HomePage extends React.Component {
114113 }
115114
116115 render ( ) {
117- let { dispatch, status, articles, allArticles, activeArticle, folders, tags, filters } = this . props
116+ let { dispatch, status, user , articles, allArticles, activeArticle, folders, tags, filters } = this . props
118117
119118 return (
120119 < div className = 'HomePage' >
121120 < ArticleNavigator
122121 ref = 'nav'
123122 dispatch = { dispatch }
123+ user = { user }
124124 folders = { folders }
125125 status = { status }
126126 allArticles = { allArticles }
@@ -172,7 +172,7 @@ function buildFilter (key) {
172172}
173173
174174function remap ( state ) {
175- let { folders, articles, status } = state
175+ let { user , folders, articles, status } = state
176176
177177 if ( articles == null ) articles = [ ]
178178 articles . sort ( ( a , b ) => {
@@ -234,6 +234,7 @@ function remap (state) {
234234 if ( activeArticle == null ) activeArticle = articles [ 0 ]
235235
236236 return {
237+ user,
237238 folders,
238239 status,
239240 allArticles,
@@ -249,11 +250,9 @@ function remap (state) {
249250}
250251
251252HomePage . propTypes = {
252- params : PropTypes . shape ( {
253- userId : PropTypes . string
254- } ) ,
255- status : PropTypes . shape ( {
256- userId : PropTypes . string
253+ status : PropTypes . shape ( ) ,
254+ user : PropTypes . shape ( {
255+ name : PropTypes . string
257256 } ) ,
258257 articles : PropTypes . array ,
259258 allArticles : PropTypes . array ,
0 commit comments