Repository URL to install this package:
|
Version:
0.14.1 ▾
|
import React from 'react'
import { DefaultProps } from 'icons/typings'
import Vector from 'atoms/Vector'
import { fromPropsToIdentifier } from 'atoms/Icons/deps'
// extending interface from Label component
interface Props extends DefaultProps { }
const wording = {
vectorClassName: 'email',
title: 'Email Icon',
description: 'An icon, representing a email panel',
}
function fromBreedToComponent(props: DefaultProps) {
const { breed, stroke, fill } = props
switch (breed) {
case 'emailV1':
return {
svgPath: (
<g transform="translate(-1.000000, 0.000000)" >
<path d="M39.1992188,9.19921875 L39.1992188,5 L22.5,15.4492188 L5.80078125,5 L5.80078125,9.19921875 L22.5,19.5507813 L39.1992188,9.19921875 Z M39.1992188,0.80078125 C40.305995,0.80078125 41.266272,1.2239541 42.080078,2.0703125 C42.8938843,2.9166709 43.3007813,3.89322362 43.3007813,5 L43.3007813,30 C43.3007813,31.1067762 42.8938843,32.083329 42.080078,32.9296875 C41.266272,33.776046 40.305995,34.1992188 39.1992188,34.1992188 L5.80078125,34.1992188 C4.69400488,34.1992188 3.73372803,33.776046 2.91992188,32.9296875 C2.10611573,32.083329 1.69921875,31.1067762 1.69921875,30 L1.69921875,5 C1.69921875,3.89322362 2.10611573,2.9166709 2.91992188,2.0703125 C3.73372803,1.2239541 4.69400488,0.80078125 5.80078125,0.80078125 L39.1992188,0.80078125 Z" />
</g>
),
viewBox: '0 0 43 35',
}
default:
return {
svgPath: (
<g strokeWidth="2">
<rect x="1" y="1" width="42" height="33" rx="2" ry="2" />
<path d="M1.29,1.14l18.93,18a3,3,0,0,0,4.14,0l18.93-18" />
<line x1="1.29" y1="34.14" x2="19.29" y2="18.14" />
<line x1="43.29" y1="34.14" x2="25.29" y2="18.14" />
</g>
),
viewBox: '0 0 44 35',
}
}
}
class EmailIcon extends React.PureComponent<Props> {
static defaultProps = {
width: '44px',
height: '35px',
viewBox: '0 0 44 35',
stroke: 'none',
fill: 'none',
}
render() {
const { svgPath, viewBox } = fromBreedToComponent(this.props)
const identifier = fromPropsToIdentifier(wording)
return (
<Vector
{...this.props}
{...wording}
viewBox={viewBox}
namespace={identifier}
>
{svgPath}
</Vector>
)
}
}
export { EmailIcon }
export default EmailIcon