# All files / components/Header Header.js

46.15% Statements 6/13
100% Branches 0/0
0% Functions 0/7
46.15% Lines 6/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

    5x

    5x

    5x

    5x

    5x
    5x

     import React from 'react';
    import PropTypes from 'prop-types';
    import styled from 'styled-components';

    import Sub from './SubHeader';

    const HeaderImpl = styled.h1.withConfig({ displayName: 'Header' })`
      color: ${({ theme }) => theme.header.fg};
      font-family: ${({ theme }) => theme.header.fontFamily};
      font-weight: ${({ theme }) => theme.header.fontWeight};
      font-size: ${({ theme }) => theme.header.fontSize};
      margin: ${({ theme }) => theme.header.margin};
      line-height: ${({ theme }) => theme.header.lineHeight};
    `;

    const Header = ({...rest, children}) => (
      <HeaderImpl {...rest}>{children}</HeaderImpl>
    )

    Header.propTypes = {
      /**
       * Adds a class name to the element.
       */
      className: PropTypes.string,
      /**
       * Adds an id to the element.
       */
      id: PropTypes.string,
    };

    Header.defaultProps = {
      className: null,
      id: null,
    };

    Header.Sub = Sub;
    Header.Styled = HeaderImpl;

    export default Header;