Sha256: 5e8944eb5c96ad7824062ea197c7bf3d9864d4b332b48450ae5b6ecce17c0c1f

Contents?: true

Size: 759 Bytes

Versions: 6

Compression:

Stored size: 759 Bytes

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'

import styles from './styles.scss'

type Props = {
  children?: Array<React.Node>,
  style: "primary" | "default" | "success" | "danger" | "warning" | "info" | "inverse",
  className: string,
}

export default class Badge extends React.Component<Props> {
  static defaultProps = {
    children: <span>{`UR Special`}</span>,
    style: "default",
    className: "",
  }
  props: Props
  render() {
    const {
      children,
      className,
      style,
    } = this.props
    const css = [
      className,
      styles.badge,
      styles[`badge-${style}`],
    ]
    return (
      <span
          className={classnames(css)}
      >
        {children}
      </span>
    )
  }
}

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
playbook_ui-2.7.2 components/Badge/Badge.jsx
playbook_ui-2.7.1 components/Badge/Badge.jsx
playbook_ui-2.7.0 components/Badge/Badge.jsx
playbook_ui-2.6.0 components/Badge/Badge.jsx
playbook_ui-2.5.0 components/Badge/Badge.jsx
nitro_sg-3.0.2 components/Badge/Badge.jsx