Skip to content

Instantly share code, notes, and snippets.

@sendbird-community
Created December 3, 2022 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sendbird-community/cb8b92c4538cdfbbbdc9a09f57109d0f to your computer and use it in GitHub Desktop.
Save sendbird-community/cb8b92c4538cdfbbbdc9a09f57109d0f to your computer and use it in GitHub Desktop.
How to implement the ChannelSettings module
import ChannelSettings from '@sendbird/uikit-react/ChannelSettings';
import { ChannelSettingsProvider, useChannelSettingsContext } from '@sendbird/uikit-react/ChannelSettings/context';
const MyComponent = () => {
const channelSettingsState = useChannelSettingsContext();
return (
...render custom component
);
};
<ChannelSettingsProvider>
<MyComponent />
<ChannelSettingsProvider/>
const LeaveChannelButton = () => {
const channelSettingsState = useChannelSettingsContext();
return (
...render custom component
);
};
<ChannelSettings
renderLeaveChannel={LeaveChannelButton}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment