PageHtmlContainer.jsx 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import React from 'react'
  2. import { connect } from 'react-redux'
  3. // import PopinFixed from '../../../component/common/PopinFixed/PopinFixed.jsx'
  4. // import PopinFixedHeader from '../../../component/common/PopinFixed/PopinFixedHeader.jsx'
  5. // import PopinFixedOption from '../../../component/common/PopinFixed/PopinFixedOption.jsx'
  6. // import PopinFixedContent from '../../../component/common/PopinFixed/PopinFixedContent.jsx'
  7. import {
  8. PopinFixed,
  9. PopinFixedHeader,
  10. PopinFixedOption,
  11. PopinFixedContent
  12. } from 'tracim_lib'
  13. import PageHtmlComponent from './PageHtmlComponent.jsx'
  14. import Timeline from '../../../component/Timeline.jsx'
  15. import { setActiveFileContentHide } from '../../../action-creator.sync.js'
  16. require('./PageHtml.styl')
  17. class PageHtmlContainer extends React.Component {
  18. handleClickBtnClose = () => this.props.dispatch(setActiveFileContentHide())
  19. render () {
  20. const { activeFileContent, app: { PageHtml } } = this.props
  21. return (
  22. <PopinFixed customClass={`${PageHtml.customClass}`}>
  23. <PopinFixedHeader
  24. customClass={`${PageHtml.customClass}`}
  25. icon={PageHtml.icon}
  26. name={activeFileContent.title}
  27. onClickCloseBtn={this.handleClickBtnClose}
  28. />
  29. <PopinFixedOption customClass={`${PageHtml.customClass}`} />
  30. <PopinFixedContent customClass={`${PageHtml.customClass}__contentpage`}>
  31. <PageHtmlComponent
  32. version={activeFileContent.version}
  33. text={activeFileContent.text}
  34. key={'PageHtml'}
  35. />
  36. <Timeline
  37. customClass={`${PageHtml.customClass}__contentpage`}
  38. key={'pageHtml__timeline'}
  39. />
  40. </PopinFixedContent>
  41. </PopinFixed>
  42. )
  43. }
  44. }
  45. const mapStateToProps = ({ activeFileContent, app }) => ({ activeFileContent, app })
  46. export default connect(mapStateToProps)(PageHtmlContainer)