ChatMessage

A single user message with avatar, nickname, timestamp, body text, optional reply quote, and reactions.

Import

import { ChatMessage } from "@gumtree/ui/chat/ChatMessage";

Props

PropTypeDefaultDescription
nickstring-Author nickname (omit for bot event wrappers)
nickColorstring-CSS color for the nickname
timestring-Timestamp text
avatarPlaceholderstring-Avatar placeholder letter
avatarColorstring-Avatar background color
avatarSrcstring-Avatar image URL
replyComponentChildren-Reply quote (use ReplyQuote)
reactionsComponentChildren-Reaction pills (use Reaction)
childrenComponentChildren-Message body (supports inline code, links, ChannelRef)

Examples

Basic Message

A
alice16:22
good, the es locale fix is shipped. carol, can you ask the testers to try v3.3.2?
<ChatMessage nick="alice" nickColor="#7a3e9d" time="16:22" avatarColor="#cba6f7">
  good, the es locale fix is shipped. carol, can you ask the testers to try v3.3.2?
</ChatMessage>

With Reactions and Channel Refs

C
carol13:44
just tested the ja locale — &quot;rendez-vous&quot; predicts correctly now! posted the good news to #beta-testers too 🎉
🎉 3
<ChatMessage nick="carol" nickColor="#b85c00" time="13:44" avatarColor="#f9e2af"
  reactions={<><Reaction emoji="🎉" count={3} /></>}>
  just tested the ja locale — "rendez-vous" predicts correctly now!
  posted the good news to <ChannelRef type="custom">#beta-testers</ChannelRef> too 🎉
</ChatMessage>

With Reply Quote

B
brendan14:08
alice should we ship this as v3.3.3 hotfix…
v3.3.3 hotfix, yeah. it's a regression from the NFKD change in v3.3.0
<ChatMessage nick="brendan" nickColor="#1a5a9a" time="14:08" avatarColor="#89b4fa"
  reply={<ReplyQuote nick="alice">should we ship this as v3.3.3 hotfix…</ReplyQuote>}>
  v3.3.3 hotfix, yeah. it's a regression from the NFKD change in v3.3.0
</ChatMessage>