2020-11-15 18:48:32 +00:00
|
|
|
import React from 'react'
|
|
|
|
import PropTypes from 'prop-types'
|
2021-01-08 05:15:53 +00:00
|
|
|
import { connect } from 'react-redux'
|
2020-11-15 18:48:32 +00:00
|
|
|
import PageTitle from '../features/ui/util/page_title'
|
2020-12-09 04:15:33 +00:00
|
|
|
import ComposeLayout from '../layouts/compose_layout'
|
|
|
|
import { BREAKPOINT_EXTRA_SMALL } from '../constants'
|
2020-11-15 18:48:32 +00:00
|
|
|
|
|
|
|
class ComposePage extends React.PureComponent {
|
|
|
|
|
2020-12-09 04:15:33 +00:00
|
|
|
componentDidMount() {
|
|
|
|
window.addEventListener('keyup', this.handleKeyUp, false)
|
|
|
|
}
|
|
|
|
|
|
|
|
componentWillUnmount() {
|
|
|
|
window.removeEventListener('keyup', this.handleKeyUp)
|
|
|
|
}
|
|
|
|
|
2020-11-15 18:48:32 +00:00
|
|
|
render() {
|
2021-01-08 05:15:53 +00:00
|
|
|
const { children, width } = this.props
|
2020-12-09 04:15:33 +00:00
|
|
|
|
|
|
|
const isXS = width <= BREAKPOINT_EXTRA_SMALL
|
2020-11-15 18:48:32 +00:00
|
|
|
|
|
|
|
return (
|
2020-12-09 04:15:33 +00:00
|
|
|
<ComposeLayout title='Compose' isXS={isXS}>
|
|
|
|
<PageTitle path='Compose' />
|
2020-11-15 18:48:32 +00:00
|
|
|
{children}
|
2020-12-09 04:15:33 +00:00
|
|
|
</ComposeLayout>
|
2020-11-15 18:48:32 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-01-08 05:15:53 +00:00
|
|
|
const mapStateToProps = (state) => ({
|
|
|
|
width: state.getIn(['settings', 'window_dimensions', 'width']),
|
|
|
|
})
|
|
|
|
|
2020-11-15 18:48:32 +00:00
|
|
|
ComposePage.propTypes = {
|
|
|
|
children: PropTypes.node.isRequired,
|
|
|
|
}
|
|
|
|
|
2021-01-08 05:15:53 +00:00
|
|
|
export default connect(mapStateToProps)(ComposePage)
|