Skip to content

Latest commit

 

History

History
85 lines (67 loc) · 2.8 KB

File metadata and controls

85 lines (67 loc) · 2.8 KB

Rocket.Chat.Livechat

When making changes, run yarn build to create a new build before merging with master

This branch contains a button component @ /src/components/Messages/MessageAction.

Screenshot 2020-06-09 at 8 43 21 PM

For example you can send a following rich message payload to use with this component:


const msgObject = {
	_id: Random.id(),
	rid: item.rid,
	msg: 'Sorry I am not sure of your request. Please select one of the following options:',
	attachments: [{
		actions: [
			{
			   type: 'button',
			   msg_in_chat_window: true,
			   msg_processing_type: 'sendMessage',
			   text: 'Contact Salesforce Agent',
			   msg: 'getSessionId',
			},
			{
			   type: 'button',
			   msg_in_chat_window: true,
			   msg_processing_type: 'sendMessage',
			   text: 'Send Random String',
			   msg: 'randomWord',
			 },
			 {
			   type: 'button',
		           msg_in_chat_window: true,
			   msg_processing_type: 'sendMessage',
	                   text: 'Close Chat',
			   msg: 'closeChat',
			 },
	],
  }],
};

Language grade: JavaScript Total alerts Storybook

CLI Commands

# install dependencies
yarn

# serve with hot reload at localhost:8080
yarn dev

# build for production with minification
yarn build

# test the production build locally
yarn serve

# run tests with jest and preact-render-spy
yarn test

# run the storybook
yarn storybook

# before commit run
yarn i18n

Screens:

image image image image image image image