ContentWrapper.js 543 B

12345678910111213141516171819202122232425
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. /**
  4. * Wrapper element for template content
  5. */
  6. const ContentWrapper = props =>(
  7. <div className="content-wrapper">
  8. {props.unwrap ?
  9. (<div className="unwrap">{props.children}</div>)
  10. :
  11. (props.children)
  12. }
  13. </div>
  14. )
  15. ContentWrapper.propTypes = {
  16. /** add element with 'unwrap' class to expand content area */
  17. unwrap: PropTypes.bool
  18. }
  19. ContentWrapper.defaultProps = {
  20. unwrap: false
  21. }
  22. export default ContentWrapper;