All files / packages/design-system/ui/components/dynamic-icons/ellie index.jsx

60% Statements 3/5
100% Branches 0/0
0% Functions 0/2
60% Lines 3/5

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              1x   1x                                                   1x            
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import _ from '../../../shared/helpers';
 
// This icon is a sprite of 20 frames laid out horizontally
// Each frame is composed of 2 circles positioned on top of each other
const frames = 20;
 
const Ellie = props => (
  <span
    className={classNames('slds-icon-ellie', props.className)}
    title={props.title}
  >
    <svg viewBox={`0 0 ${frames * 14} 14`} aria-hidden="true">
      {/* Loop through frames 1 through 20 */}
      {_.range(1, frames + 1).map(frame => [
        <circle
          cx={14 * frame - 7}
          cy="7"
          r="4"
          key={`outer-circle-${frame}`}
        />,
        <circle
          cx={14 * frame - 7}
          cy="7"
          r="3"
          key={`inner-circle-${frame}`}
        />
      ])}
    </svg>
    <span className="slds-assistive-text">{props.assistiveText}</span>
  </span>
);
 
Ellie.propTypes = {
  title: PropTypes.string.isRequired,
  assistiveText: PropTypes.string.isRequired
};
 
export default Ellie;