This branch contains a button component @ /src/components/Messages/MessageAction
.
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',
},
],
}],
};
# 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