import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import { CX, BREAKPOINT_SMALL, } from '../../constants' import { me, emailConfirmed, } from '../../initial_state' import Button from '../button' import { openModal } from '../../actions/modal' import Responsive from '../../features/ui/util/responsive_component' import Heading from '../heading' import BackButton from '../back_button' import Pills from '../pills' class SidebarLayout extends React.PureComponent { handleOpenComposeModal = () => { this.props.onOpenComposeModal() } render() { const { actions, tabs, title, showBackBtn, children, } = this.props const innerContainerClasses = CX({ d: 1, posFixed: 1, calcH53PX: emailConfirmed || !me, calcH106PX: !emailConfirmed && !!me, bottom0: 1, }) return (
{ !!title &&
{ showBackBtn && } {title} { !!actions &&
{ actions.map((action, i) => (
}
} { !!tabs &&
}
) } } const mapDispatchToProps = (dispatch) => ({ onOpenComposeModal() { dispatch(openModal('COMPOSE')) }, }) SidebarLayout.propTypes = { onOpenComposeModal: PropTypes.func.isRequired, actions: PropTypes.array, tabs: PropTypes.array, title: PropTypes.string, showBackBtn: PropTypes.bool, } export default connect(null, mapDispatchToProps)(SidebarLayout)