Sha256: af4f6844d2a1251ad783783e383ad6a2b26e5af7f337f6111b5ae31c9a0928d4

Contents?: true

Size: 1.2 KB

Versions: 3

Compression:

Stored size: 1.2 KB

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'
import { Avatar, Body, Title } from '../'
import { globalProps } from '../utilities/globalProps.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}`, globalProps(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

3 entries across 3 versions & 1 rubygems

Version Path
playbook_ui-6.2.1 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-6.2.0 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-7.0.0.pre.alpha1 app/pb_kits/playbook/pb_user/_user.jsx