Sha256: 0f34876784067f56a21a6e3cc68a74b35167f4442f77bc4e78154c94a48db947

Contents?: true

Size: 1.01 KB

Versions: 123

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

123 entries across 123 versions & 1 rubygems

Version Path
playbook_ui-9.6.1.pre.deps1 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.6.0 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.5.0.alpha.rs.downgrade app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.5.0 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.4.0.alpha.sisense app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.4.0.alpha.user.kit.bug app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.4.0 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.3.1.pre.alpha2 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.4.0.pre.alpha2 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.4.0.pre.alpha1 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.3.1.pre.alpha1 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.3.0.alpha.inline3 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.3.0.pre.alpha.password.strength.2 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.3.0.alpha.inline2 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.3.0.alpha.inline1 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.3.0.pre.alpha.password.strength.1 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.3.0 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.2.2.pre.alpha.margin app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.2.2 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
playbook_ui-9.2.1 app/pb_kits/playbook/pb_user_badge/_user_badge.jsx