Sha256: 8a0a2a1bfff2cefa5bbf1a156d0e9a7db41d724b2693a36768658ea226d3199e

Contents?: true

Size: 1.01 KB

Versions: 85

Compression:

Stored size: 1.01 KB

Contents

/* @flow */
import React from 'react'
import classnames from 'classnames'
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
import { globalProps } from '../utilities/globalProps.js'

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 = require(`./badges/_${badge}.svg`)
  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">
        <img src={image} />
      </div>
    </div>
  )
}
export default UserBadge

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
playbook_ui-7.3.0.pre.alpha7 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.3.0.pre.alpha6 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.3.0.pre.alpha5 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.3.0.pre.alpha4 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.3.0.pre.alpha3 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.3.0.pre.alpha1 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.2.0 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.1.2 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.1.0.pre.alpha2 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.1.1.pre.alpha1 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.0.1 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.1.1 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.1.0.pre.alpha1 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.1.0 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.0.1.pre.alpha15 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-6.8.2.pre.alpha1 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.0.0.pre.alpha15 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.0.1.pre.alpha14 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.0.0.pre.alpha14 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-7.0.0.pre.alpha13 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx