Sha256: dda8868855e678eb3c1146516ca329617cca3f9b91acc55bac05c0be75d0442c

Contents?: true

Size: 1.18 KB

Versions: 44

Compression:

Stored size: 1.18 KB

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'
import { Avatar, Body, Title } from '../'
import { spacing } from '../utilities/spacing.js'

type UserProps = {
  className?: String,
  id?: String,
  name: String,
  territory?: String,
  title?: String,
  size?: "sm" | "md" | "lg",
  align?: "left" | "center" | "right",
  orientation?: "horiztonal" | "vertical",
  avatar?: Boolean,
  avatarUrl?: String,
}

const User = (props: UserProps) => {
  const {
    name = '',
    territory = '',
    title = '',
    align = 'left',
    orientation = 'horizontal',
    size = 'sm',
    avatar = false,
    avatarUrl,
  } = props
  return (
    <div className={classnames(`pb_user_kit_${align}_${orientation}_${size}`, spacing(props))}>
      <If condition={avatar || avatarUrl}>
        <Avatar
            imageUrl={avatarUrl}
            name={name}
            size={size}
        />
      </If>

      <div className="content_wrapper">
        <Title
            size={size == 'lg' ? 3 : 4}
            text={name}
        />
        <Body color="light">
          {territory == '' ? title : `${territory} • ${title}`}
        </Body>
      </div>
    </div>
  )
}

export default User

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
playbook_ui-6.0.1.pre.alpha5 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-6.0.1.pre.alpha4 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-6.0.1.pre.alpha3 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-6.0.1.pre.alpha2 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-5.2.0.pre.alpha15 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-5.2.0.pre.alpha14 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-5.2.0.pre.alpha13 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-6.0.1 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-5.2.0.pre.alpha12 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-6.0.0 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-5.2.0.pre.alpha11 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-5.5.1.pre.alpha4 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-5.5.1.pre.alpha3 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-5.5.1.pre.alpha2 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-5.5.1.pre.alpha1 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-5.2.0.pre.alpha10 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-5.5.1 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-5.5.0 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-5.5.0.pre.alpha1 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-5.2.0.pre.alpha9 app/pb_kits/playbook/pb_user/_user.jsx