0.0.3 • Published 9 months ago

@sendbird/react-uikit-message-template-view v0.0.3

Weekly downloads
-
License
-
Repository
github
Last release
9 months 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.3

9 months ago

0.0.1-alpha.78

11 months ago

0.0.1-alpha.77

1 year ago

0.0.1-alpha.79

11 months ago

0.0.1-alpha.74

1 year ago

0.0.1-alpha.76

1 year ago

0.0.1-alpha.75

1 year ago

0.0.2

9 months ago

0.0.1-alpha.73

1 year ago

0.0.1-alpha.72

1 year ago

0.0.1-alpha.70

1 year ago

0.0.1-alpha.71

1 year ago

0.0.1-alpha.69

1 year ago

0.0.1-alpha.67

1 year ago

0.0.1-alpha.68

1 year ago

0.0.1-alpha.66

1 year ago

0.0.1-alpha.65

1 year ago

0.0.1-alpha.63

1 year ago

0.0.1-alpha.64

1 year ago

0.0.1-alpha.62

1 year ago

0.0.1-alpha.61

1 year ago

0.0.1-alpha.60

1 year ago

0.0.1-alpha.59

1 year ago

0.0.1-alpha.58

1 year ago

0.0.1-alpha.57

1 year ago

0.0.1-alpha.56

1 year ago

0.0.1-alpha.55

1 year ago

0.0.1-alpha.52

1 year ago

0.0.1-alpha.54

1 year ago

0.0.1-alpha.53

1 year ago

0.0.1-alpha.50

1 year ago

0.0.1-alpha.51

1 year ago

0.0.1-alpha.49

1 year ago

0.0.1-alpha.48

2 years ago

0.0.1-alpha.47

2 years ago

0.0.1-alpha.46

2 years ago

0.0.1-alpha.45

2 years ago

0.0.1-alpha.44

2 years ago

0.0.1-alpha.41

2 years ago

0.0.1-alpha.40

2 years ago

0.0.1-alpha.43

2 years ago

0.0.1-alpha.42

2 years ago

0.0.1-alpha.39

2 years ago

0.0.1-alpha.29

2 years ago

0.0.1-alpha.33

2 years ago

0.0.1-alpha.36

2 years ago

0.0.1-alpha.38

2 years ago

0.0.1-alpha.37

2 years ago

0.0.1-alpha.30

2 years ago

0.0.1-alpha.32

2 years ago

0.0.1-alpha.31

2 years ago

0.0.1-alpha.23

2 years ago

0.0.1-alpha.22

2 years ago

0.0.1-alpha.25

2 years ago

0.0.1-alpha.24

2 years ago

0.0.1-alpha.27

2 years ago

0.0.1-alpha.18

2 years ago

0.0.1-alpha.28

2 years ago

0.0.1-alpha.17

2 years ago

0.0.1-alpha.21

2 years ago

0.0.1-alpha.20

2 years ago

0.0.1-alpha.19

2 years ago

0.0.1-alpha.16

2 years ago

0.0.1-alpha.12

2 years ago

0.0.1-alpha.10

2 years ago

0.0.1-alpha.9

2 years ago

0.0.1-alpha.8

2 years ago

0.0.1-alpha.7

2 years ago

0.0.1-alpha.6

2 years ago

0.0.1-alpha.5

2 years ago

0.0.1-alpha.4

2 years ago