Sha256: b1f8cd42f4433be26555df1698910e50d4068c46166e44d5e079573d76903900

Contents?: true

Size: 1.13 KB

Versions: 99

Compression:

Stored size: 1.13 KB

Contents

/* @flow */
import React from 'react'
import classnames from 'classnames'
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
import { globalProps } from '../utilities/globalProps'
import Veteran from './badges/veteran.jsx';
import MillionDollar from './badges/million-dollar.jsx';


type UserBadgeProps = {
  aria?: object,
  badge?: "million-dollar" | "veteran",
  className?: string,
  data?: object,
  id?: string,
  size?: "sm" | "md" | "lg",
}

const UserBadge = (props: UserBadgeProps) => {
  const {
    aria = {},
    badge = 'million-dollar',
    className,
    data = {},
    id,
    size = 'md',
  } = props

  const image = badge === "million-dollar" ? <MillionDollar /> : <Veteran />
  const ariaProps = buildAriaProps(aria)
  const dataProps = buildDataProps(data)
  const classes = classnames(
    buildCss('pb_user_badge_kit', size),
    globalProps(props),
    className
  )

  return (
    <div
        {...ariaProps}
        {...dataProps}
        className={classes}
        id={id}
    >
      <div className="pb_user_badge_wrapper">
        {image}
      </div>
    </div>
  )
}
export default UserBadge

Version data entries

99 entries across 99 versions & 1 rubygems

Version Path
playbook_ui-12.20.0.pre.alpha.movemarkdown668 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.20.0.pre.alpha.title2667 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.20.0.pre.alpha.title2665 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.20.0 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.19.0.pre.alpha.PLAY699zindexresponsive650 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.19.0.pre.alpha.movemarkdown639 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.19.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown638 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.19.0.pre.alpha.movemarkdown637 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.18.0.pre.alpha.PLAY785typeaheadts632 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.19.0 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown629 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown628 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.18.0.pre.alpha.play786multilevelselectimprovements627 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown626 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown617 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.18.0.pre.alpha.PLAY735mobileheadersfix616 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.18.0.pre.alpha.play786multilevelselectimprovements613 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.18.0.pre.alpha.PLAY747carddarktokens610 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.18.0.pre.alpha.PLAY785typeaheadts608 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-12.18.0.pre.alpha.PLAY785typeaheadts607 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx