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:
// modules
import React from 'react'
// domain
import { Button } from 'atoms/Button'
// local
import { classes } from './fixture'
import {
  propTypes,
  TelephoneProps,
  TelephoneAttributes,
  TelephoneAttributesOrProps,
} from './typings'
import { StyledTelephoneValue } from './styled'
import { toAttributes } from './deps'

class Telephone extends React.PureComponent<TelephoneProps> {
  static defaultProps = {
    shouldFormat: true,
    shouldUseIcon: true,
  }

  render() {
    const { renderIcon, render, attributes, telephone, shouldUseIcon } = toAttributes(this.props)

    // safety & defaults
    if (!telephone) {
      return ''
    }

    const iconView = renderIcon(attributes)
    const numberView = render({ children: telephone })
    return (
      <Button {...attributes}>
        {iconView}
        {numberView}
      </Button>
    )
  }
}

export { Telephone }
export default Telephone