import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import { BREAKPOINT_SMALL, } from '../../constants' 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 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)