Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
import React from 'react'
import { DefaultProps } from 'icons/typings'
import Vector from 'atoms/Vector'

// extending interface from Label component
interface Props extends DefaultProps {}

const wording = {
  description: 'An Icon which represents lock or unlock',
  title: 'Lock Icon',
}

function fromBreedToComponent(type: string) {
  switch (type) {
    case 'open':
      return 'M 1.6 13.91 a 20.74 19.74 0 0 1 38.9 11.22'
    case 'close':
    default:
      return 'M 1.2 20.91 a 19.74 20.74 0 0 1 39 0.22'
  }
}

class LockIcon extends React.PureComponent<Props> {
  static defaultProps = {
    width: '42px',
    height: '52.39px',
    viewBox: '0 0 42 52.39',
    stroke: '#000000',
    type: 'close',
  }

  render() {
    const { type, ...remainingProps } = this.props
    const stateDPath = fromBreedToComponent(type)
    return (
      <Vector {...remainingProps} {...wording}>
        <g fill="none" strokeWidth="2">
          <path d={stateDPath} strokeMiterlimit="10" strokeLinecap="round" />
          <path
            d="M1 24.25h39.47v22.2a4.93 4.93 0 0 1-4.93 4.93H5.93A4.93 4.93 0 0 1 1 46.46V24.25z"
            strokeLinejoin="round"
          />
          <line
            x1="21.41"
            y1="34.74"
            x2="21.41"
            y2="39.74"
            strokeLinecap="round"
            strokeLinejoin="round"
          />
        </g>
      </Vector>
    )
  }
}

export { LockIcon }
export default LockIcon