|
4 | 4 |
|
5 | 5 | **BREAKING CHANGES** |
6 | 6 |
|
7 | | -*ChannelList* |
| 7 | +## MessageInput |
| 8 | + |
| 9 | +- Replaced the default image picker [react-native-image-picker](https://github.com/react-native-community/react-native-image-picker) for [react-native-image-crop-picker](https://github.com/ivpusic/react-native-image-crop-picker) and added `compressImageQuality` prop to support image compression out-of-the-box |
| 10 | +- Added `FileUploadPreview` and `ImageUploadPreview` props to support custom overrides to those components |
| 11 | + |
| 12 | +## KeyboardCompatibleView and Channel component |
| 13 | + |
| 14 | +Implementation of internal KeyboardCompatibleView has been changed so as to make animations smoother and fix existing issues with keyboard behavior. |
| 15 | +Support for following props have been dropped from Channel and KeyboardCompatibleView |
| 16 | + |
| 17 | +- keyboardDismissAnimationDuration |
| 18 | +- keyboardOpenAnimationDuration |
| 19 | + |
| 20 | +Following new props have been introduced on `Channel` component. They are the same props accepted by KeyboardAvoidingView of react-native. |
| 21 | + |
| 22 | +- keyboardBehavior ['height' | 'position' | 'padding'] |
| 23 | +- keyboardVerticalOffset |
| 24 | + |
| 25 | + |
| 26 | +## ChannelList |
8 | 27 |
|
9 | 28 | - We converted the ChannelList component from a class to a function and abstracted the event listener logic into custom hooks. The default event handlers can still be overridden by providing custom prop functions to the ChannelList component. Custom logic can be provided for the following events: |
10 | 29 |
|
|
21 | 40 | - 1st argument: `setChannels` reference to the `useState` hook that sets the `channels` in the React Native FlatList |
22 | 41 | - 2nd argument: `event` object returned by the StreamChat instance |
23 | 42 |
|
| 43 | +e.g., |
| 44 | + |
| 45 | +```js |
| 46 | +// In following example we will override the default handler for notification.added_to_channel |
| 47 | +<ChannelList |
| 48 | + filters={} |
| 49 | + onAddedToChannel={(setChannels, event) => { |
| 50 | + setChannels(channels => { |
| 51 | + // Do additional actions on channels array. |
| 52 | + return channels; |
| 53 | + }) |
| 54 | + }} |
| 55 | +> |
| 56 | +``` |
24 | 57 | - On upgrading to this release, ensure events and any custom handling functions (ex: `onAddedToChannel` or `onMessageNew`) are properly processed and update the list UI as expected. |
25 | 58 |
|
26 | | -*FileUploadPreview* |
| 59 | +## FileUploadPreview |
27 | 60 |
|
28 | 61 | - We fixed a bug for being unable to remove a file from the `MessageInput` and made it consistent to `ImageUploadPreview` |
29 | 62 | - We have removed support for the `fileUploadPreview.dismissText` theme value |
30 | 63 | - We have added support for `fileUploadPreview.dismiss`, `fileUploadPreview.dismissImage`, and `fileUploadPreview.imageContainer` theme values |
31 | 64 |
|
32 | | -*MessageInput* |
33 | | - |
34 | | -- We replaced the default image picker [react-native-image-picker](https://github.com/react-native-community/react-native-image-picker) for [react-native-image-crop-picker](https://github.com/ivpusic/react-native-image-crop-picker) and added `compressImageQuality` prop to support image compression out-of-the-box |
35 | | -- Added `FileUploadPreview` and `ImageUploadPreview` props to support custom overrides to those components |
36 | | - |
37 | | -*Deprecated Props* |
| 65 | +## Deprecated Props |
38 | 66 |
|
39 | | -- We have removed support for the `MessageList` component's `onMessageTouch` prop. Since this prop no longer exists, we have also removed `dismissKeyboardOnMessageTouch`. Please use the `onPress` prop on the `MessageSimple` component to perform an action on touch of a message. |
| 67 | +- We have removed support for the `MessageList` component's `onMessageTouch` prop. Please use the `onPress` prop on the `MessageSimple` component to perform an action on touch of a message. |
40 | 68 |
|
41 | 69 | - We have removed support for the `Message` component's `readOnly` prop. Please use the `disabled` value from the `ChannelContext` instead. |
42 | 70 |
|
43 | 71 | - We have also dropped support for the following `MessageList` props: |
44 | 72 | - `dateSeparator` (use DateSeparator instead) |
45 | 73 | - `headerComponent` (use HeaderComponent instead) |
46 | 74 |
|
47 | | -*this Reference Removal* |
| 75 | +## this Reference Removal |
48 | 76 |
|
49 | 77 | - We have removed the `this` class component reference from the prop functions in `MessageSimple`. For example, if you wish to override the SDK's standard long press behavior on a message, the `onLongPress` function passed in to `MessageSimple` no longer takes the `this` component reference as it's first argument. The message and the event object become the first and second arguments, respectively. |
50 | 78 |
|
51 | | -*renderText Function* |
| 79 | +## renderText Function |
52 | 80 |
|
53 | 81 | - The `renderText` function utilized in the `MessageTextContainer` component now accepts a single object containing `markdownRules`, `markdownStyles`, and `message`. Previously each value was a separate function parameter. |
54 | 82 |
|
|
0 commit comments