# All files / components/Navigation NavigationTitle.js

0% Statements 0/2
100% Branches 0/0
0% Functions 0/1
0% Lines 0/2

    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

     import React from 'react';
    import PropTypes from 'prop-types';
    import Logo from '../Logo';
    import NavigationLogoPairWrapper from './styles/NavigationLogoPairWrapper';
    import NavigationHeading from './styles/NavigationHeading';

    class LogoHeader extends React.Component {
      static propTypes = {
        /**
         * The title to render inside the header.
         */
        children: PropTypes.string,
        /**
         * Adds a class name to the whole containing header element.
         */
        className: PropTypes.string,
        /**
         * Adds an id to the whole containing header element.
         */
        id: PropTypes.string,
        /**
         * A component to wrap the logo and heading text
         */
        LogoPairWrapper: PropTypes.func,
        /**
         * A component to render the heading text
         */
        Heading: PropTypes.func,
      };

      static defaultProps = {
        children: 'Bandwidth',
        className: null,
        id: null,
        LogoPairWrapper: NavigationLogoPairWrapper,
        Heading: NavigationHeading,
      };

      render() {
        const { children, id, className, LogoPairWrapper, Heading } = this.props;

        return (
          <LogoPairWrapper id={id} className={className}>
            <Logo />
            <Heading>{children}</Heading>
          </LogoPairWrapper>
        );
      }
    }

    export default LogoHeader;