# All files / layouts/SidebarLayout SidebarLayout.js

0% Statements 0/18
0% Branches 0/16
0% Functions 0/7
0% Lines 0/13

    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
    53
    54
    55

     import PropTypes from 'prop-types';
    import styled from 'styled-components';
    import get from 'extensions/themeGet';

    const SidebarLayout = styled.div.withConfig({ displayName: 'SidebarLayout' })`
      display: flex;
      flex-direction: row;
      align-items: stretch;
      margin: 0;
      padding: 0;

      & > *:${props => (props.right ? 'last-child' : 'first-child')} {
        flex: 3;
      }

      & > *:${props => (props.right ? 'first-child' : 'last-child')} {
        flex: 6;
        background: ${get('colors.gray.light')};
        border-${props => (props.right ? 'right' : 'left')}-width: ${get(
      'thicknesses.normal',
    )};
        border-${props => (props.right ? 'right' : 'left')}-style: solid;
        border-${props => (props.right ? 'right' : 'left')}-color: ${get(
      'colors.border.light',
    )};
        margin-${props => (props.right ? 'right' : 'left')}: -1px;
      }
    `;

    SidebarLayout.propTypes = {
      /**
       * Adds an id to the element.
       */
      id: PropTypes.string,
      /**
       * Adds a class name to the element.
       */
      className: PropTypes.string,
      /**
       * Sidebar is put on the right side instead of left.
       */
      right: PropTypes.bool,
    };

    SidebarLayout.defaultProps = {
      id: null,
      className: null,
      right: false,
    };

    /**
     * @component
     */
    export default SidebarLayout;