0.0.1-alpha.73 • Published 17 days ago

@sendbird/react-uikit-message-template-view v0.0.1-alpha.73

Weekly downloads
-
License
-
Repository
github
Last release
17 days ago

@sendbird/react-uikit-message-template-view

This package renders UI for react applications using Sendbird Message Template. It is used in Notification Channels in Sendbird UIKit for React. It is a part of an initiative in Sendbird to implement Notfication Channels. Using Message Templates, customers can define a template for a notification message and use it to send notifications to targetted users which should be rendered in the same way on all the client platforms & devices

Read more: https://sendbird.atlassian.net/wiki/spaces/UK/pages/1929610099/UIKit+Message+template

Usage

npm i @sendbird/react-uikit-message-template-view
import {
  MessageTemplate,
  MessageProvider,
  useMessageContext,
} from '@sendbird/react-uikit-message-template-view';

Usage

<MessageProvider
  message={message}
  handleWebAction={handleWebAction}
  handleCustomAction={handleCustomAction}
  handlePredefinedAction={handlePredefinedAction}
>
  <MessageTemplate templateItems={messageTemplate?.body?.items} />
</MessageProvider>

useMessageContext is used inside MessageTemplate to fetch the message and the handlers. You need useMessageContext only when you are creating custom MessageTemplates

const {
  message,
  // see Action Handlers section for more details
  handleWebAction,
  handleCustomAction,
  handlePredefinedAction,
} = useMessageContext() as MessageContextInterface;

Action Handlers

handleWebAction is used to handle web actions. It takes a url as a parameter and opens it in a new tab

handleCustomAction is used to handle custom actions. It takes a custom action as a parameter and executes it

handlePredefinedAction is used to handle predefined actions. It takes a predefined action as a parameter and executes it

handleWebAction?(event: React.SyntheticEvent, action: Action, message: BaseMessage);
handleCustomAction?(event: React.SyntheticEvent, action: Action, message: BaseMessage);
handlePredefinedAction?(event: React.SyntheticEvent, action: Action, message: BaseMessage);
0.0.1-alpha.73

17 days ago

0.0.1-alpha.72

1 month ago

0.0.1-alpha.70

1 month ago

0.0.1-alpha.71

1 month ago

0.0.1-alpha.69

1 month ago

0.0.1-alpha.67

1 month ago

0.0.1-alpha.68

1 month ago

0.0.1-alpha.66

2 months ago

0.0.1-alpha.65

2 months ago

0.0.1-alpha.63

3 months ago

0.0.1-alpha.64

2 months ago

0.0.1-alpha.62

3 months ago

0.0.1-alpha.61

3 months ago

0.0.1-alpha.60

3 months ago

0.0.1-alpha.59

3 months ago

0.0.1-alpha.58

3 months ago

0.0.1-alpha.57

4 months ago

0.0.1-alpha.56

4 months ago

0.0.1-alpha.55

4 months ago

0.0.1-alpha.52

4 months ago

0.0.1-alpha.54

4 months ago

0.0.1-alpha.53

4 months ago

0.0.1-alpha.50

4 months ago

0.0.1-alpha.51

4 months ago

0.0.1-alpha.49

4 months ago

0.0.1-alpha.48

5 months ago

0.0.1-alpha.47

5 months ago

0.0.1-alpha.46

5 months ago

0.0.1-alpha.45

5 months ago

0.0.1-alpha.44

5 months ago

0.0.1-alpha.41

6 months ago

0.0.1-alpha.40

6 months ago

0.0.1-alpha.43

6 months ago

0.0.1-alpha.42

6 months ago

0.0.1-alpha.39

10 months ago

0.0.1-alpha.29

1 year ago

0.0.1-alpha.33

12 months ago

0.0.1-alpha.36

11 months ago

0.0.1-alpha.38

11 months ago

0.0.1-alpha.37

11 months ago

0.0.1-alpha.30

1 year ago

0.0.1-alpha.32

12 months ago

0.0.1-alpha.31

1 year ago

0.0.1-alpha.23

1 year ago

0.0.1-alpha.22

1 year ago

0.0.1-alpha.25

1 year ago

0.0.1-alpha.24

1 year ago

0.0.1-alpha.27

1 year ago

0.0.1-alpha.18

1 year ago

0.0.1-alpha.28

1 year ago

0.0.1-alpha.17

1 year ago

0.0.1-alpha.21

1 year ago

0.0.1-alpha.20

1 year ago

0.0.1-alpha.19

1 year ago

0.0.1-alpha.16

1 year ago

0.0.1-alpha.12

1 year ago

0.0.1-alpha.10

1 year ago

0.0.1-alpha.9

1 year ago

0.0.1-alpha.8

1 year ago

0.0.1-alpha.7

1 year ago

0.0.1-alpha.6

1 year ago

0.0.1-alpha.5

1 year ago

0.0.1-alpha.4

1 year ago