Sha256: f9288490bb4731fee1e9939ed16455804afcb7ed33cdfcf3e28d8ea678029531

Contents?: true

Size: 1.05 KB

Versions: 38

Compression:

Stored size: 1.05 KB

Contents

/* @flow */

import React from 'react'

import { Avatar, Body, Caption } from '../'

type MessageProps = {
  avatarName?: String,
  avatarStatus?: String,
  avatarUrl?: String,
  label?: String,
  message: String,
  timestamp?: String,
}

const Message = ({
  avatarName = '',
  avatarUrl = '',
  label = '',
  message = '',
  timestamp = '',
  avatarStatus = null,
}: MessageProps) => {
  const shouldDisplayAvatar = avatarUrl || avatarName
  const classes = shouldDisplayAvatar ? 'pb_message_kit_avatar' : 'pb_message_kit'

  return (
    <div className={classes}>
      <If condition={shouldDisplayAvatar}>
        <Avatar
            imageUrl={avatarUrl}
            name={avatarName}
            size="sm"
            status={avatarStatus}
        />
      </If>
      <div className="content_wrapper">
        <If condition={label}>
          <Caption>{label}</Caption>
        </If>
        <Body>{message}</Body>
        <If condition={timestamp}>
          <Caption size="xs">{timestamp}</Caption>
        </If>
      </div>
    </div>
  )
}

export default Message

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
playbook_ui-4.17.0.pre.alpha1 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.16.0 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.15.0 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.14.0 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.15.1.alpha1 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.13.1 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.13.0 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.12.0 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.11.0 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.11.0.pre.alpha3 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.11.0.pre.alpha.pre.2 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.10.0 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.10.0.pre.alpha1 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.9.0.pre.alpha1 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.9.0 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.8.2 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.8.1 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.7.1 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.7.0 app/pb_kits/playbook/pb_message/_message.jsx
playbook_ui-4.6.1 app/pb_kits/playbook/pb_message/_message.jsx