|
1 | 1 | # Changelog - v3
|
2 | 2 |
|
| 3 | +## [v3.13.3] (Mar 22, 2024) |
| 4 | + |
| 5 | +### Features |
| 6 | +* Added a `renderMenuItem` to the `MessageMenu` component |
| 7 | + * How to use? |
| 8 | + ```tsx |
| 9 | + <GroupChannel |
| 10 | + renderMessageContent={(props) => ( |
| 11 | + <MessageContent |
| 12 | + {...props} |
| 13 | + renderMessageMenu={(props) => ( |
| 14 | + <MessageMenu |
| 15 | + {...props} |
| 16 | + renderMenuItem={(props) => { |
| 17 | + const { |
| 18 | + className, |
| 19 | + onClick, |
| 20 | + dataSbId, |
| 21 | + disable, |
| 22 | + text, |
| 23 | + } = props; |
| 24 | + return <MenuItem /> // Render Custom Menu Item |
| 25 | + }} |
| 26 | + /> |
| 27 | + )} |
| 28 | + /> |
| 29 | + )} |
| 30 | + /> |
| 31 | + ``` |
| 32 | +* Added `onBeforeDownloadFileMessage` to the `<GroupChannel />` and `<Thread />` modules |
| 33 | + * How to use? |
| 34 | + ```tsx |
| 35 | + const ONE_MB = 1024 * 1024; |
| 36 | + /** |
| 37 | + * Use this list to check if it's displayed as a ThumbnailMessage. |
| 38 | + * (https://github.com/sendbird/sendbird-uikit-react/blob/main/src/utils/index.ts) |
| 39 | + */ |
| 40 | + const ThumbnailMessageTypes = [ |
| 41 | + 'image/jpeg', |
| 42 | + 'image/jpg', |
| 43 | + 'image/png', |
| 44 | + 'image/gif', |
| 45 | + 'image/svg+xml', |
| 46 | + 'image/webp', // not supported in IE |
| 47 | + 'video/mpeg', |
| 48 | + 'video/ogg', |
| 49 | + 'video/webm', |
| 50 | + 'video/mp4', |
| 51 | + ]; |
| 52 | + |
| 53 | + <GroupChannel // or Thread |
| 54 | + onBeforeDownloadFileMessage={async ({ message, index = null }) => { |
| 55 | + if (message.isFileMessage()) { |
| 56 | + const confirmed = window.confirm(`The file size is ${(message.size / ONE_MB).toFixed(2)}MB. Would you like to continue downloading?`); |
| 57 | + return confirmed; |
| 58 | + } |
| 59 | + if (message.isMultipleFilesMessage()) { |
| 60 | + const confirmed = window.confirm(`The file size is ${(message.fileInfoList[index].fileSize / ONE_MB).toFixed(2)}MB. Would you like to continue downloading?`); |
| 61 | + return confirmed; |
| 62 | + } |
| 63 | + return true; |
| 64 | + }} |
| 65 | + /> |
| 66 | + ``` |
| 67 | +* Added `onDownloadClick` to the `FileViewer`, `FileViewerView`, `MobileBottomSheet`, `MobileContextMenu`, and `MobileMenu` |
| 68 | + |
| 69 | +### Fixes |
| 70 | +* Improved the stability of the ChannelSettings Modals |
| 71 | + * Support menu on the `MembersModal`, `MutedMembersModal`, and `OperatorsModal` |
| 72 | + * Display `Operator` description on the `MembersModal` |
| 73 | +* Fixed the `width` size of the `OGMessageItemBody` component |
| 74 | +* Added fallback logic on template rendering error |
| 75 | +* Replaced the hardcoded text ` (You)` with the StringSet `CHANNEL_SETTING__MEMBERS__YOU` in the `UserListItem` |
| 76 | + |
3 | 77 | ## [v3.13.2] (Mar 14, 2024)
|
4 | 78 |
|
5 | 79 | ### Features
|
6 |
| -* Add a `renderHeader` props to the ChannelSettingsUIProps |
| 80 | +* Added a `renderHeader` props to the ChannelSettingsUIProps |
7 | 81 | ```
|
8 | 82 | <ChannelSettingsUI
|
9 | 83 | renderHeader={() => ...}
|
|
0 commit comments