2017-11-05 23:59:18 +00:00
|
|
|
import React from 'react'
|
|
|
|
import { connect } from 'react-redux'
|
2017-11-13 23:39:08 +00:00
|
|
|
import { setCurrentChapter } from '../actions'
|
2017-11-05 23:59:18 +00:00
|
|
|
|
2017-11-22 20:17:27 +00:00
|
|
|
const Page = ({currentChapter, highlightActive}) =>
|
|
|
|
<div id="page" className={highlightActive ? 'show_notes' : 'hide_notes'}>
|
2017-11-22 03:52:32 +00:00
|
|
|
<div dangerouslySetInnerHTML={{__html: currentChapter.text}} />
|
|
|
|
</div>
|
2017-11-05 23:59:18 +00:00
|
|
|
|
|
|
|
const mapStateToProps = state => {
|
|
|
|
return {
|
2017-11-22 20:17:27 +00:00
|
|
|
currentChapter: state.currentChapter,
|
|
|
|
highlightActive: state.highlightActive
|
2017-11-05 23:59:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-26 14:47:19 +00:00
|
|
|
const PageContainer = connect(mapStateToProps)(Page)
|
2017-11-05 23:59:18 +00:00
|
|
|
|
|
|
|
export default PageContainer
|