@sendbird/uikit-react
Advanced tools
Changelog
[v3.14.12] (July 3, 2024)
RTL Support
htmlTextDirection
prop to SendbirdProvider
to support Right-To-Left (RTL) text direction for Middle East customers. Read more.import ar from 'date-fns/locale/ar';
<SendbirdProvider
...
htmlTextDirection={'rtl' | 'ltr'}
// Setting a proper value to dateLocale would be necessary
dateLocale={ar}
>
</SendbirdProvider>
DX Improvements: ChannelSetting SettingMenu
ChannelSettingsUI
more modular and customizable.useMenuItems.tsx
: Custom hook for menu items based on user roles.MenuItem.tsx
: Reusable and customizable menu item component.MenuListByRole.tsx
: Renders a list of menu items based on user roles.import React from 'react';
import ChannelSettingsUI from '@sendbird-uikit/ChannelSettings/components/ChannelSettingsUI';
import useMenuItems from '@sendbird-uikit/ChannelSettings/hooks/useMenuList';
const CustomChannelSettings = () => {
const menuItems = useMenuItems();
const renderCustomModerationPanel = () => {
// Create a new object by selecting only the desired menu items.
const customMenuItems = {
operator: {
operators: menuItems.operator.operators, // Keep the operators menu
allUsers: menuItems.operator.allUsers, // Keep the all users menu
// Add or remove other menu items as needed.
},
nonOperator: {
allUsers: menuItems.nonOperator.allUsers, // Keep the all users menu
// Add or remove other menu items as needed.
},
};
return <MenuListByRole menuItems={customMenuItems} />;
};
return (
<ChannelSettingsUI renderModerationPanel={renderCustomModerationPanel} />
);
};
export default CustomChannelSettings;
DX Improvements: ChannelSetting UserListItem
UserListItemMenu
has been newly createdUserListItemMenuProvider
and useUserListItemMenuContext
import { UserListItemMenu, UserListItemMenuProvider, useUserListItemMenuContext } from '@sendbird/uikit-react/ui/UserListItemMenu';
renderUserListItem
props to the list components of ChannelSettings
:
OperatorList
, MemberList
, MutedMemberList
, BannedUserList
OperatorList
, MemberList
, MutedMemberList
, BannedUserList
import { OperatorList, MemberList, MutedMemberList, BannedUserList } from '@sendbird/uikit-react/ChannelSettings/components/ChannelSettingsUI';
ui/UserListItem
and ChannelSettings/components/UserListItem
:
ui/UserListItem
from now onsize
prop to UserListItem
, which now accepts two values: 'normal' and 'small' ('small' replaces the previous ChannelSettings/components/UserListItem
)
normal
: Used primarily in Modalssmall
: Used primarily in Lists<ChannelSettings
renderUserListItem={(props) => (
<UserListItem {...props}
renderListItemMenu={(props) => (
<UserListItemMenu
{...props}
onToggleOperatorState={({ user, newState, error }) => {/** Handle operator state change */}}
onToggleMuteState={({ user, newState, error }) => {/** Handle mute state change */}}
onToggleBanState={({ user, newState, error }) => {/** Handle ban state change */}}
renderTrigger={({ ref }) => (<div ref={ref}>{/** Render your custom trigger icon here */}</div>)}
renderMenuItems={({ items }) => (
<>
<items.OperatorToggleMenuItem />
<items.MuteToggleMenuItem />
<items.BanToggleMenuItem />
</>
)}
/>
)}
/>
)}
/>
isSuperGroupReactionsEnabled
setterAPP_LAYOUT_ROOT
to get the area info of the UIKit
export const APP_LAYOUT_ROOT = 'sendbird-app__layout';
SendbirdProvider
with a tag that has the specified ID.@sendbird/chat
version to 4.13.0
Changelog
[v3.14.11] (June 20, 2024)
Markdown Support for Text Messages
enableMarkdownForUserMessage
to UIKitOptions
. When enabled, markdown syntaxes for bold and link are now applied to user messages.Descriptive Color Names Support
mapColorKeys
, to support both new and existing color names.Primary-500 -> Primary-extra dark
Primary-400 -> Primary-dark
Primary-300 -> Primary-main
Primary-200 -> Primary-light
Primary-100 -> Primary-extra light
Secondary-500 -> Secondary-extra dark
Secondary-400 -> Secondary-dark
Secondary-300 -> Secondary-main
Secondary-200 -> Secondary-light
Secondary-100 -> Secondary-extra light
Overlay-01 -> Overlay-dark
Overlay-02 -> Overlay-light
// On Light
On Light-01 -> Onlight-text-high-emphasis
On Light-02 -> Onlight-text-mid-emphasis
On Light-03 -> Onlight-text-low-emphasis
On Light-04 -> Onlight-text-disabled
// On Dark
On Dark -01 -> Ondark-text-high-emphasis
On Dark -02 -> Ondark-text-mid-emphasis
On Dark -03 -> Ondark-text-low-emphasis
On Dark -04 -> Ondark-text-disabled
Message Menu Component Refactor
Created MessageMenuProvider
, useMessageMenuContext
, and MessageMenu
component.
Replaced MessageItemMenu
with MessageMenu
in GroupChannel. Future PR will apply it to Thread.
Migrated MobileContextMenu
and MobileBottomSheet
using MessageMenuProvider
.
Exported the MobileMenu
import { MobileMenu, MobileContextMenu, MobileBottomSheet } from '@sendbird/uikit-react/ui/MobileMenu';
How to use?
Desktop menu
import GroupChannel from '@sendbird/uikit-react/GroupChannel';
import MessageContent from '@sendbird/uikit-react/ui/MessageContent';
import { MessageMenu } from '@sendbird/uikit-react/ui/MessageMenu';
const GroupChannelPage = () => (
<GroupChannel
renderMessageContent={(props) => (
<MessageContent
{...props}
renderMessageMenu={(props) => (
<MessageMenu
{...props}
renderMenuItems={(props) => {
const {
CopyMenuItem,
ReplyMenuItem,
// ...
DeleteMenuItem,
} = props.items;
// organize the menu items using the items
return (
<>
<CopyMenuItem />
<DeleteMenuItem />
</>
);
}}
/>
)}
/>
)}
/>
);
Mobile menu
import GroupChannel from '@sendbird/uikit-react/GroupChannel';
import MessageContent from '@sendbird/uikit-react/ui/MessageContent';
import { MobileMenu } from '@sendbird/uikit-react/ui/MessageMenu';
const GroupChannelPage = () => (
<GroupChannel
renderMessageContent={(props) => (
<MessageContent
{...props}
renderMobileMenuOnLongPress={(props) => (
<MobileMenu
{...props}
renderMenuItems={(props) => {
const {
CopyMenuItem,
ReplyMenuItem,
// ...
DeleteMenuItem,
} = props.items;
// organize the menu items using the items
return (
<>
<CopyMenuItem />
<DeleteMenuItem />
</>
);
}}
/>
)}
/>
)}
/>
);
newMessages
array was not being reset even after the message list scroll reached the bottom, causing the message notification bar to not disappear properly. Manually called resetNewMessages()
under certain conditions.disabled
conditions are checked.Changelog
[v3.14.10] (June 13, 2024)
onClose
event to the modals inside of the FileViewer
components.Changelog
[v3.14.9] (June 7, 2024)
audio/x-m4a
to ensure proper playback.FileViewer
components for utilizing the onMounted
event handler.