import React, { Component } from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' export default class PageContainerHeader extends Component { static propTypes = { title: PropTypes.string, subtitle: PropTypes.string, onClose: PropTypes.func, showBackButton: PropTypes.bool, onBackButtonClick: PropTypes.func, backButtonStyles: PropTypes.object, backButtonString: PropTypes.string, tabs: PropTypes.node, } renderTabs () { const { tabs } = this.props return tabs && ( ) } renderHeaderRow () { const { showBackButton, onBackButtonClick, backButtonStyles, backButtonString } = this.props return showBackButton && (
{ backButtonString || 'Back' }
) } render () { const { title, subtitle, onClose, tabs } = this.props return (
{ this.renderHeaderRow() } { title &&
{ title }
} { subtitle &&
{ subtitle }
} { onClose &&
onClose()} /> } { this.renderTabs() }
) } }