Commit 128c10b
authored
release: v3.7.0 (#819)
[v3.7.0] (Oct 23 2023)
### Multiple Files Message
Now we are supporting Multiple Files Message feature!<br/>
You can select some **multiple files** in the message inputs, and send
**multiple images** in one message.<br/>
If you select several types of files, only images will be combined in
the message and the other files will be sent separately.
Also we have resolved many issues found during QA.
#### How to enable this feature?
You can turn it on in four places.
1. App Component
```tsx
import App from '@sendbird/uikit-react/App'
<App
...
isMultipleFilesMessageEnabled
/>
```
2. SendbirdProvider
```tsx
import { SendbirdProvider } from '@sendbird/uikit-react/SendbirdProvider'
<SendbirdProvider
...
isMultipleFilesMessageEnabled
>
{...}
</SendbirdProvider>
```
3. Channel
```tsx
import Channel from '@sendbird/uikit-react/Channel';
import { ChannelProvider } from '@sendbird/uikit-react/Channel/context';
<Channel
...
isMultipleFilesMessageEnabled
/>
<ChannelProvider
...
isMultipleFilesMessageEnabled
>
{...}
</ChannelProvider>
```
3. Thread
```tsx
import Thread from '@sendbird/uikit-react/Thread';
import { ThreadProvider } from '@sendbird/uikit-react/Thread/context';
<Thread
...
isMultipleFilesMessageEnabled
/>
<ThreadProvider
...
isMultipleFilesMessageEnabled
>
{...}
</ThreadProvider>
```
### Interface change/publish
* The properties of the `ChannelContext` and `ThreadContext` has been
changed little bit.
* `allMessages` of the ChannelContext has been divided into
`allMessages` and `localMessages`
* `allThreadMessages` of the ThreadContext has been divided into
`allThreadMessages` and `localThreadMessages`
* Each local messages includes `pending` and `failed` messages, and the
all messages will contain only `succeeded` messages
* **Please keep in mind, you have to migrate to using the local
messages, IF you have used the `local messages` to draw your custom
message components.**
* pubSub has been published
* `publishingModules` has been added to the payload of pubSub.publish
You can specify the particular modules that you propose for event
publishing
```tsx
import { useCallback } from 'react'
import { SendbirdProvider, useSendbirdStateContext } from
'@sendbird/uikit-react/SendbirdProvider'
import { PUBSUB_TOPICS as topics, PublishingModuleTypes } from
'@sendbird/uikit-react/pubSub/topics'
const CustomApp = () => {
const globalState = useSendbirdStateContext();
const { stores, config } = globalState;
const { sdk, initialized } = stores.sdkStore;
const { pubSub } = config;
const onSendFileMessageOnlyInChannel = useCallback((channel, params) =>
{
channel.sendFileMessage(params)
.onPending((pendingMessage) => {
pubSub.publish(topics.SEND_MESSAGE_START, {
channel,
message: pendingMessage,
publishingModules: [PublishingModuleTypes.CHANNEL],
});
})
.onFailed((failedMessage) => {
pubSub.publish(topics.SEND_MESSAGE_FAILED, {
channel,
message: failedMessage,
publishingModules: [PublishingModuleTypes.CHANNEL],
});
})
.onSucceeded((succeededMessage) => {
pubSub.publish(topics.SEND_FILE_MESSAGE, {
channel,
message: succeededMessage,
publishingModules: [PublishingModuleTypes.CHANNEL],
});
})
}, []);
return (<>...</>)
};
const App = () => (
<SendbirdProvider>
<CustomApp />
</SendbirdProvider>
);
```
### Fixes:
* Improve the pubSub&dispatch logics
* Allow deleting failed messages
* Check applicationUserListQuery.isLoading before fetching user list
* Fix the error message: "Query in progress."
* Fix missed or wrong type definitions
* `quoteMessage` of ChannelProviderInterface
* `useEditUserProfileProviderContext` has been renamed to
`useEditUserProfileContext`
```tsx
import { useEditUserProfileProviderContext } from
'@sendbird/uikit-react/EditUserProfile/context'
// to
import { useEditUserProfileContext } from
'@sendbird/uikit-react/EditUserProfile/context'
```1 parent cc40138 commit 128c10b
2 files changed
+135
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
2 | 136 | | |
3 | 137 | | |
4 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments