This repository was archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
[RFC] Chat.Item grouped prop for describing groups of chat items #588
Copy link
Copy link
Closed
Labels
Description
[RFC] Chat.Item grouped prop for describing groups of chat items
Legend:
- batch: group of consecutive messages from the same participant
Problem description
What?
We need a way to describe either:
- batches of chat messages;
- or chat messages that are not the first in a batch.
Why?
There are scenarios where there needs to be a clear visual indication that differentiates messages within a batch:
- redundant subcomponents;
- different styling (fitted consecutive messages).
Current:
Expected:
Proposed solutions
1. Introduce grouped prop on Chat.Item component to suggest they are part of a batch:
API:
<Chat>
<Chat.Item
grouped
gutter={...}
content={(
<Chat.Message
content="Hi"
author="Jane Doe"
timestamp="Yesterday, 10:15 PM"
/>
)}
/>
<Chat.Item
gutter={...}
content={<Chat.Message content="How are you todau?" author="Jane Doe" timestamp="Yesterday, 10:15 PM" />}
/>
<Chat.Item
gutter={...}
content={<Chat.Message content="*today" author="Jane Doe" timestamp="Yesterday, 10:15 PM" />}
/>
</Chat>2. Introduce the notion of Chat.Message.Group for a group of consecutive messages from one participant:
API:
<Chat>
<Chat.Item
gutter={...}
content={(
// Their group
<Chat.Message.Group>
<Chat.Message content="Hi" author="Jane Doe" timestamp="Yesterday, 10:15 PM" />
<Chat.Message content="How are you today?" author="Jane Doe" timestamp="Yesterday, 10:15 PM" />
<Chat.Message content="Good, and you?" mine author="Jane Doe" timestamp="Yesterday, 10:15 PM" />
</Chat.Message.Group>
)}
/>
<Chat.Item
gutter={...}
content={(
// My group
<Chat.Message.Group>
<Chat.Message content="Good, and you?" mine author="Jane Doe" timestamp="Yesterday, 10:15 PM" />
</Chat.Message.Group>
)}
/>
</Chat>3. Try to achieve the visual differences with current capabilities (might not cover all scenarios):
- we will just not add
gutter,authorandtimestampsubcomponents - we will remove extra margins between messages and replace them with invisible
Dividercomponents that we'd add manually between batches
Reactions are currently unavailable

