@@ -12,6 +12,7 @@ import { inject, observer } from 'mobx-react'
1212import { makeDebugger , storePlug , ROUTE } from '../../utils'
1313
1414import PostsContent from './PostsContent'
15+ import JobsContent from './JobsContent'
1516import TagsContent from './TagsContent'
1617
1718import { Wrapper } from './styles'
@@ -21,15 +22,19 @@ import * as logic from './logic'
2122const debug = makeDebugger ( 'C:CommunityContent' )
2223/* eslint-enable no-unused-vars */
2324
24- const renderChildContent = ( curRoute , store , restProps ) => {
25- const { pagedPostsData, pagedTagsData } = store
26-
25+ const ChildContent = ( {
26+ curRoute,
27+ pagedPostsData,
28+ pagedJobsData,
29+ pagedTagsData,
30+ restProps,
31+ } ) => {
2732 switch ( curRoute . subPath ) {
2833 case ROUTE . POSTS : {
2934 return < PostsContent data = { pagedPostsData } restProps = { restProps } />
3035 }
3136 case ROUTE . JOBS : {
32- return < h3 > ROUTE.JOBS </ h3 >
37+ return < JobsContent data = { pagedJobsData } restProps = { restProps } / >
3338 }
3439 case ROUTE . REPOS : {
3540 return < h3 > ROUTE.REPOS</ h3 >
@@ -61,12 +66,23 @@ class CommunityContentContainer extends React.Component {
6166
6267 render ( ) {
6368 const { communityContent } = this . props
64- const { curRoute } = communityContent
69+ const {
70+ curRoute,
71+ pagedPostsData,
72+ pagedJobsData,
73+ pagedTagsData,
74+ } = communityContent
6575 const restProps = { ...communityContent }
6676
6777 return (
6878 < Wrapper >
69- { renderChildContent ( curRoute , communityContent , restProps ) }
79+ < ChildContent
80+ curRoute = { curRoute }
81+ pagedPostsData = { pagedPostsData }
82+ pagedJobsData = { pagedJobsData }
83+ pagedTagsData = { pagedTagsData }
84+ restProps = { restProps }
85+ />
7086 </ Wrapper >
7187 )
7288 }
0 commit comments