@@ -12,6 +12,7 @@ import { inject, observer } from 'mobx-react'
12
12
import { makeDebugger , storePlug , ROUTE } from '../../utils'
13
13
14
14
import PostsContent from './PostsContent'
15
+ import JobsContent from './JobsContent'
15
16
import TagsContent from './TagsContent'
16
17
17
18
import { Wrapper } from './styles'
@@ -21,15 +22,19 @@ import * as logic from './logic'
21
22
const debug = makeDebugger ( 'C:CommunityContent' )
22
23
/* eslint-enable no-unused-vars */
23
24
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
+ } ) => {
27
32
switch ( curRoute . subPath ) {
28
33
case ROUTE . POSTS :{
29
34
return < PostsContent data = { pagedPostsData } restProps = { restProps } />
30
35
}
31
36
case ROUTE . JOBS :{
32
- return < h3 > ROUTE.JOBS </ h3 >
37
+ return < JobsContent data = { pagedJobsData } restProps = { restProps } / >
33
38
}
34
39
case ROUTE . REPOS :{
35
40
return < h3 > ROUTE.REPOS</ h3 >
@@ -61,12 +66,23 @@ class CommunityContentContainer extends React.Component {
61
66
62
67
render ( ) {
63
68
const { communityContent} = this . props
64
- const { curRoute} = communityContent
69
+ const {
70
+ curRoute,
71
+ pagedPostsData,
72
+ pagedJobsData,
73
+ pagedTagsData,
74
+ } = communityContent
65
75
const restProps = { ...communityContent }
66
76
67
77
return (
68
78
< Wrapper >
69
- { renderChildContent ( curRoute , communityContent , restProps ) }
79
+ < ChildContent
80
+ curRoute = { curRoute }
81
+ pagedPostsData = { pagedPostsData }
82
+ pagedJobsData = { pagedJobsData }
83
+ pagedTagsData = { pagedTagsData }
84
+ restProps = { restProps }
85
+ />
70
86
</ Wrapper >
71
87
)
72
88
}