Skip to content

Conversation

adrian-moovup
Copy link

For renderMessageBody to be a viable option to extend upon the default message types, would like to be able to import MessageBody when using the library.

  • MessageContent is not customizable with three new optional properties:
    • renderSenderProfile, renderMessageBody, and renderMessageHeader
    • How to use?
      import Channel from '@sendbird/uikit-react/Channel'
      import { useSendbirdStateContext } from '@sendbird/uikit-react/useSendbirdStateContext'
      import { useChannelContext } from '@sendbird/uikit-react/Channel/context'
      import MessageContent from '@sendbird/uikit-react/ui/MessageContent'
      
      const CustomChannel = () => {
        const { config } = useSendbirdStateContext();
        const { userId } = config;
        const { currentGroupChannel } = useChannelContext();
        return (
          <Channel
            ...
            renderMessage={({ message }) => {
              return (
                <MessageContent
                  userId={userId}
                  channel={currentGroupChannel}
                  message={message}
                  ...
                  renderMessageBody={(props: MessageBodyProps) => (
                    <MessageBody {...props}/>
                  )}
                />
              )
            }}
          />
        )
      }

Copy link

netlify bot commented Aug 5, 2024

‼️ Deploy request for sendbird-uikit-react rejected.

Name Link
🔨 Latest commit b3f9cf7

@HoonBaek
Copy link
Contributor

Thank you for your interest in our project @adrian-moovup !
It seems that the PR you created can be replaced by this one #1195.
Thank you!

@HoonBaek
Copy link
Contributor

#1195

@HoonBaek HoonBaek closed this Aug 16, 2024
HoonBaek added a commit that referenced this pull request Aug 23, 2024
made from: #1190

#### Changelog
* Exported subcomponents of `MessageContent`
  ```tsx
import { MessageBody, MessageHeader, MessageProfile } from
'@sendbird/uikit-react/ui/MessageContent';
  ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants