-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathHome.jsx
More file actions
56 lines (49 loc) · 1.59 KB
/
Home.jsx
File metadata and controls
56 lines (49 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import React, { Component , PropTypes } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import Episode from "../Podcasts/Components/Episode"
import MailingList from "../Common/Components/MailingList"
import EpisodePlayer from "./EpisodePlayer"
import HomepageFeature from "./HomepageFeature"
import BlogContainer from 'Blog/Routes/BlogContainer'
import {changePageTitle} from '../Layout/Actions/LayoutActions';
import {get_homepage_content} from '../utils/redux_loader'
class Home extends Component {
componentWillMount() {
var dispatch = this.props.dispatch
const {title} = Home.getPageMeta()
dispatch(changePageTitle(title))
dispatch({type: "CMS_GET_HOMEPAGE_CONTENT", payload: {dispatch} })
}
static getPageMeta() {
return {
title: `Data Skeptic`
}
}
render() {
var ocms = this.props.cms.toJS()
var latest_episode_blog = ocms.latest_episode
var guid = latest_episode_blog['guid']
var oepisodes = this.props.episodes.toJS()
var ep_map = oepisodes.ep_map
var latest_episode = ep_map[guid]
return (
<div className="center">
<div className="row">
<div className="col-xs-12 col-sm-8">
<HomepageFeature />
</div>
<div className="col-xs-12 col-sm-4">
<EpisodePlayer episode={latest_episode} />
<MailingList />
</div>
</div>
<div className="clear"></div>
</div>
);
}
}
export default connect(state => ({
episodes: state.episodes,
cms: state.cms
}))(Home)