Repository URL to install this package:
|
Version:
0.9.5 ▾
|
// 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