# All files / components/Logo Logo.js

0% Statements 0/31
0% Branches 0/8
0% Functions 0/5
0% Lines 0/18

    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
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71

     import React from 'react';
    import PropTypes from 'prop-types';
    import themeGet from 'extensions/themeGet';
    import { defaultProps } from 'recompose';
    import irisTheme from 'theme/irisTheme';
    import LogoSvg from './logo.svg';
    import styled from 'styled-components';

    // const Logo = ({ width, height, color, style, ...rest }) => (
    //   <LogoSvg style={{ width, height, fill: color, ...style }} {...rest} />
    // );
    //
    const Logo = styled(LogoSvg)`
      width: ${({ width }) => width};
      fill: ${({ color }) => (color ? color : themeGet('colors.text.inverted'))};
      height: ${({ height }) => (height ? height : themeGet('spacing.large'))};
    `;

    Logo.propTypes = {
      /**
       * Adds a class name to the logo image.
       */
      className: PropTypes.string,
      /**
       * Adds an id to the logo image.
       */
      id: PropTypes.string,
      /**
       * Sets the color of the logo.
       */
      color: PropTypes.string,
      /**
       * Manually control the width of the logo. If only width is set, height
       * will be based on the aspect ratio.
       */
      width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
      /**
       * Manually control the width of the logo. If only height is set, width
       * will be based on the aspect ratio.
       */
      height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
    };

    Logo.defaultProps = {
      className: null,
      id: null,
      color: null,
      height: null,
    };

    Logo.Small = styled(Logo)`
      height: ${themeGet('spacing.medium')};
    `;
    Logo.Large = styled(Logo)`
      height: ${themeGet('spacing.extraLarge')};
    `;

    Logo.Primary = styled(Logo)`
      fill: ${themeGet('colors.primary.default')};
    `;
    Logo.Primary.Small = styled(Logo)`
      fill: ${themeGet('colors.primary.default')};
      height: ${themeGet('spacing.medium')};
    `;
    Logo.Primary.Large = styled(Logo)`
      fill: ${themeGet('colors.primary.default')};
      height: ${themeGet('spacing.extraLarge')};
    `;

    export default Logo;