Skip to content

Commit 56c0b41

Browse files
authored
feat: new reaction list design and improvements to MessageSimple component (#2700)
* feat: add new message action list and reaction selector UI * fix: remove unnecessary props from OverlayContext * docs: add comments for the props * tests: add tests for the components * tests: add tests for the components * fix: chat.test.ts * fix: chat.test.ts * fix: add tests for the code * fix: use rn animated to create new modal and add docs * fix: add opacity for the message action list item when pressed * fix: make modal better and change component names * fix: update test snapdhots * docs: message actions customizations * docs: message actions customizations * fix: theme improvements * fix: message component render improvements * docs: update migration guide * feat: new reaction list design and improvements to MessageSimple component * tests: add tests for the components * docs: reaction list new design docs * docs: add changes to migration guide * docs: add changes to migration guide * docs: add changes to migration guide * chore: resolve conflicts from base branch * chore: resolve conflicts from base branch * fix: sample app overlay backdrop bug * fix: reaction list type * feat: add FlatList for Reaction Picker * feat: add FlatList for Reaction Picker * feat: add FlatList for Reaction Picker
1 parent 1c52f4f commit 56c0b41

File tree

68 files changed

+2552
-1359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2552
-1359
lines changed

.styles/Vocab/Base/accept.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ async
4545
Podfile
4646
pickFile
4747
onChange
48+
pressable
49+
Pressable
4850
boolean
4951
Async
5052
subscribable
475 KB
Loading

docusaurus/docs/reactnative/basics/migrating-from-5.x-to-6.x.mdx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ The Message Menu design has been revamped to provide a better user experience. T
9090
The previous overlay design has been replaced with a bottom sheet modal design.
9191
:::
9292

93+
#### Introduce new ReactionList design
94+
95+
We have introduced a new ReactionList design that is more intuitive and provides a better user experience.
96+
97+
![Message Menu](../assets/basics/migrating-from-5.x-to-6.x/message_reactions.png)
98+
99+
You can switch to `bottom` reaction list design by setting the [`reactionListPosition`](../core-components/channel.mdx#reactionlistposition) prop to `bottom` in the `Channel` component. The Reaction list component can be completely customized by providing a custom component to the [`ReactionListTop`](../core-components/channel.mdx#reactionlisttop) prop in the `Channel` component for top reactions list and [`ReactionListBottom`](../core-components/channel.mdx#reactionlistbottom) prop for bottom reactions list. The default mode is `top` as it was in the previous version.
100+
93101
#### Remove `StreamChatRN` and introduce `ChatConfigContext`
94102

95103
The `StreamChatRN` global config is removed in favour of the `ChatConfigContext`. The `ChatConfigContext` is a more versatile and feature-rich context that can be used to provide any global configuration to the chat application.
@@ -153,7 +161,7 @@ The `MessageOverlay` component has been removed in favour of `MessageMenu`. The
153161

154162
The `MessageOverlay` component is removed from top level `OverlayProvider` and is replaced with `MessageMenu` in the level of the `Message` component.
155163

156-
#### Remove prop from `Message` component.
164+
#### Remove props from `Message` component.
157165

158166
The following props have been removed from the `Message` component:
159167

@@ -165,6 +173,23 @@ The following props have been removed from the `Message` component:
165173

166174
The later 3 props are removed in favour of similar props on MessagesContext and is therefore not needed. The `setData` prop is removed in favour of the removal of `MessageOverlayContext` and the `setOverlay` is not needed as we don't set the message overlay in `OverlayProvider`.
167175

176+
#### Removed props from `MessageContent` component
177+
178+
The following props have been removed from the `MessageContent` component:
179+
180+
- `hasReactions`, `lastGroupMessage`, `members`, `onlyEmojis`, `showMessageStatus` imported from the Message Context.
181+
- `addtionalTouchableProps` is changed to `additionalPressableProps`.
182+
- `MessageFooter`, `MessageHeader`, `MessageDeleted`, `MessagePinnedHeader`, `MessageReplies`, `MessageStatus`, `onPressInMessage` imported from the Messages Context.
183+
184+
The props were redundant as per the new fixes in the Reaction Design and message simple component's improvements.
185+
186+
#### Add props to `MessageSimple` component
187+
188+
The components from the `MessageContent` components are rendered now in `MessageSimple` component so few of the props that were removed from `MessageContent` are added to `MessageSimple` component(as mentioned above).
189+
190+
- `isMyMessage`, `lastGroupMessage`, `members`, `onlyEmojis`, `otherAttachments`, `showMessageStatus` imported from the Message Context.
191+
- `MessageDeleted`, `MessageFooter`, `MessageHeader`, `MessagePinnedHeader`, `MessageReplies`, `MessageStatus`, `ReactionListBottom`, `reactionListPosition` and `ReactionListTop` imported from the Messages Context.
192+
168193
#### Added `BottomSheetModal` component
169194

170195
The version introduces a very basic `BottomSheetModal` component that can be used to show a modal at the bottom of the screen. This can be used to show the message actions and reactions.
@@ -186,6 +211,10 @@ registerNativeHandlers({
186211

187212
The type of `quotedMessage` is changed from `MessageType | boolean` to `MessageType | undefined` for better in the `MessageInputContext`.
188213

214+
#### Refactor of theme object
215+
216+
The default theme object has been refactored to provide a better customization experience. The theme object is now more organized and provides better control over the customization. You can check the object [here](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/contexts/themeContext/utils/theme.ts).
217+
189218
#### Remove the deprecated code
190219

191220
- We have removed `loadChannelAtMessage` from channel context because it was no more used.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Channel instance from the StreamChat client.
2+
3+
| Type |
4+
| ------------------------------------------------------------------------------------------- |
5+
| [Channel](https://getstream.io/chat/docs/javascript/creating_channels/?language=javascript) |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
A function that scrolls to a specific message in the chat. This function is useful when you want to scroll to a specific message in the chat.
2+
3+
| Type | Default |
4+
| ------------------------------------------- | ----------- |
5+
| `(messageId: string) => void`\| `undefined` | `undefined` |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Function to handle a reaction on a message. This function is called when a user reacts to a message. The function is passed the message ID, the reaction type, and the user ID of the user who reacted to the message. The function should update the message with the reaction and update the message in the message context.
2+
3+
| Type | Default |
4+
| -------------------------------------------------------- | ----------- |
5+
| `(reactionType: string) => Promise<void>` \| `undefined` | `undefined` |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Boolean to check the message edited label is expanded or not.
2+
3+
| Type | Default |
4+
| ------- | ------- |
5+
| Boolean | `false` |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Additional props provided to the underlying [Pressable](https://reactnative.dev/docs/pressable#props) used by components within a message such as [`MessageContent`](../../../../ui-components/message-content.mdx).
2+
3+
| Type |
4+
| ------ |
5+
| object |

docusaurus/docs/reactnative/common-content/ui-components/channel/props/additional_touchable_props.mdx

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Component to render list of reactions at the bottom of the message bubble.
2+
3+
| Type | Default |
4+
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5+
| ComponentType | [`ReactionListBottom`](https://github.com/GetStream/stream-chat-react-native/tree/develop/package/src/components/Message/MessageSimple/ReactionList/ReactionListBottom.tsx) |

0 commit comments

Comments
 (0)