-
Notifications
You must be signed in to change notification settings - Fork 144
/
FrontPageLayout.js
40 lines (33 loc) · 1.03 KB
/
FrontPageLayout.js
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
import React, {Component, PropTypes} from 'react'
import PostContent from '../posts/PostContent'
import Page from '../pages/page.js'
class FrontPageLayout extends Component {
render() {
const {loading} = this.props.page
if (!loading) {
const {post_content: content, thumbnail} = this.props.page
const bg = {backgroundImage: `url("${thumbnail}")`}
const heroClass = thumbnail ? 'hero_thumbnail' : 'hero'
return (
<Page>
<div styleName={heroClass} style={bg}>
<div styleName="wrapper tight">
<h1 styleName="title">WordExpress</h1>
<h4 styleName="subtitle">WordPress using Node, Express, and React.</h4>
</div>
</div>
<div styleName="content">
<div styleName="wrapper tight">
<PostContent content={content}/>
</div>
</div>
</Page>
)
}
return <div>Loading...</div>
}
}
FrontPageLayout.propTypes = {
page: PropTypes.object
}
export default FrontPageLayout