Sha256: 0183fd621bc99f8a8cc5c5f0d867ee9e2ffa55184958c72983b1e9f36c49d31a

Contents?: true

Size: 1.2 KB

Versions: 7

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

7 entries across 7 versions & 1 rubygems

Version Path
playbook_ui-6.1.0.pre.alpha5 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-6.1.0.pre.alpha4 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-6.1.0.pre.alpha3 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-6.1.0.pre.alpha2 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-6.1.0.pre.alpha1 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-6.1.0 app/pb_kits/playbook/pb_user/_user.jsx
playbook_ui-6.0.1.pre.alpha6 app/pb_kits/playbook/pb_user/_user.jsx