Repository URL to install this package:
Version:
0.9.6 ▾
|
import React from 'react'
import { PlusMinusProps } from './typings'
import { defaultRenderIconView, defaultWrapper } from './renderProps'
class PlusMinusIcon extends React.PureComponent<PlusMinusProps> {
static defaultProps = {
type: 'plus',
isDisabled: false,
nowrap: false,
renderIconView: defaultRenderIconView,
renderWrapper: defaultWrapper,
}
render() {
const { className, renderIconView, renderWrapper, type, isDisabled } = this.props
const label = type + ' icon'
const iconView = renderIconView(this.props)
const attributes = {
className,
type,
isDisabled,
'aria-disabled': isDisabled,
'aria-label': label,
}
return renderWrapper(this.props, attributes, iconView)
}
}
export { PlusMinusIcon }
export default PlusMinusIcon