# All files / layouts/Pane Pane.js

60% Statements 3/5
100% Branches 0/0
0% Functions 0/1
60% Lines 3/5

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52

    4x
    4x
    4x

     import React from 'react';
    import PropTypes from 'prop-types';
    import styled from 'styled-components';
    import H1 from 'components/H';
    import Column from './PaneColumn';
    import Row from './PaneRow';
    import Section from './PaneSection';
    import theme from '../../theme';
    import PaneStyles from './styles/PaneStyles';

    class Pane extends React.Component {
      static propTypes = {
        /**
         * Contents of the pane.
         */
        children: PropTypes.node.isRequired,
        /**
         * Adds an id to the pane.
         */
        id: PropTypes.string,
        /**
         * Adds a class name to the pane.
         */
        className: PropTypes.string,
        /**
         * A component to render the pane itself.
         */
        Styles: PropTypes.func,
      };

      static defaultProps = {
        className: null,
        id: null,
        Styles: PaneStyles,
      };

      render() {
        const { title, children, className, id, Styles } = this.props;

        return (
          <Styles className={className} id={id}>
            {children}
          </Styles>
        );
      }
    }

    Pane.Column = Column;
    Pane.Row = Row;
    Pane.Section = Section;
    export default Pane;