Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sendbird/uikit-message-template

Package Overview
Dependencies
Maintainers
0
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sendbird/uikit-message-template

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18K
decreased by-21.94%
Maintainers
0
Weekly downloads
 
Created
Source

message-template

This package provides utilities to parse Message Template strings.

@sendbird/uikit-message-template

Message Template is born as 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/uikit-message-template
import {
  createParser,
  createRenderer,
  createMessageTemplate,
} from ' @sendbird/uikit-message-template';

createParser

const parser = createParser({
  mapBoxProps(props) {
    const styles = generateStylesFromProps(props);
    return styles;
  },
  mapTextProps(props) { .. },
  mapImageProps(props) { .. },
  mapTextButtonProps(props) { .. },
  mapImageButtonProps(props) { .. },
});

createRenderer

export const renderer = createRenderer({
  views: {
    box(props) {
      // render your component for given type
      return (<div>{props.text}</div>);
    },
    text(props) { ... },
    image(props) { ... },
    textButton(props) { ... },
    imageButton(props) { ... },
  },
});

createMessageTemplate

const { MessageTemplate } = createMessageTemplate({
  renderer,
  parser,
  Container: ({ children }) => {
    return (
      <div className="sb-message-template__parent">
        {children}
      </div>
    );
  },
});

FAQs

Package last updated on 08 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc