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    
@skava/ui / src / components / atoms / MaterialIcon / MaterialIcon.tsx
Size: Mime:
import React from 'react'
import { MaterialIconProps } from './typings'
import { defaultRenderIcon, defaultWrapper } from './renderProps'
import { defaultPathAliases, defaultPaths } from './paths'

class MaterialIcon extends React.PureComponent<MaterialIconProps> {
  static defaultProps = {
    type: 'empty',
    isDisabled: false,
    isSelected: false,
    nowrap: false,
    renderIcon: defaultRenderIcon,
    renderWrapper: defaultWrapper,
    pathAliases: defaultPathAliases,
    paths: defaultPaths,
  }
  render() {
    const {
      className,
      renderIcon,
      renderWrapper,
      type,
      isDisabled,
      isSelected,
      onClick,
    } = this.props

    const label = type + ' icon'
    const icon = renderIcon(this.props)

    const attributes = {
      className,
      type,
      isDisabled,
      isSelected,
      isInteractive: onClick !== undefined,
      'aria-disabled': isDisabled,
      'aria-label': label,
    }

    return renderWrapper(this.props, attributes, icon)
  }
}

export { MaterialIcon }
export default MaterialIcon