-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
49 lines (43 loc) · 1.46 KB
/
index.js
File metadata and controls
49 lines (43 loc) · 1.46 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
import React, { PureComponent } from "react"
import "./style.scss"
import { connect } from "react-redux"
import Markdown from "../Markdown"
import { content as selectContent } from "../../redux/staticcontent/selectors"
class BlockSection extends PureComponent {
render() {
const {
title,
subtitle,
children,
extra,
partner_extra,
halfpage,
inverted,
className,
} = this.props
return (
<div className={`BlockSection ${halfpage ? "BlockSection--half" : ""}
${inverted ? "BlockSection--inverted" : ""} ${className ? className : ""}`}>
<div className="BlockSection--left">
<h2 className="BlockSection--left__title">{title}</h2>
<Markdown
className="BlockSection--left__subtitle"
source={subtitle}
/>
{partner_extra}
{extra}
</div>
<div className="BlockSection--right">{children}</div>
</div>
)
}
}
const mapStateToProps = (state, ownProps) => {
const { titleKey, subtitleKey } = ownProps
const content = selectContent(state)
return {
title: content[titleKey] || ownProps.title,
subtitle: content[subtitleKey] || ownProps.subtitle,
}
}
export default connect(mapStateToProps)(BlockSection)