# All files / react/Layout Layout.jsx

62.5% Statements 5/8
0% Branches 0/2
0% Functions 0/3
62.5% Lines 5/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    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

    1x

    1x

    1x

    1x

    1x

     import React from 'react'
    import PropTypes from 'prop-types'
    import styles from './styles.styl'
    import cx from 'classnames'

    export const Layout = ({ children, className, monoColumn, ...rest }) => {
      return (
        <div
          className={cx(
            monoColumn ? styles['o-layout'] : styles['o-layout-2panes'],
            className
          )}
          {...rest}
        >
          {children}
        </div>
      )
    }

    export const Main = ({ children, className, ...rest }) => {
      return (
        <main className={className} {...rest}>
          {children}
        </main>
      )
    }

    export const Content = ({ children, className, ...rest }) => {
      return (
        <div role="main" className={className} {...rest}>
          {children}
        </div>
      )
    }

    Layout.propTypes = {
      children: PropTypes.node,
      className: PropTypes.string,
      monoColumn: PropTypes.bool
    }

    Layout.defaultProps = {
      monoColumn: false
    }