Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I proceed to use UIKit for a custom chat client? #406

Open
albertosgz opened this issue Mar 2, 2021 · 0 comments
Open

How can I proceed to use UIKit for a custom chat client? #406

albertosgz opened this issue Mar 2, 2021 · 0 comments

Comments

@albertosgz
Copy link

Describe the behavior
I want to reuse the UI Kit from RocketChat in order to draw modals or messages in our custom client chat.
For example, for the poll plugin, I follow the workflow, and the chat integrated by RocketChat is able to render the 'blocks' structure received. How can I reuse that part of the code? is there a function where I can pass the json and receive the html code ready to display?

Let's say something like this:

htmlCode = render({
               ...
               "submit":{
                  "type":"button",
                  "text":{
                     "type":"plain_text",
                     "text":"Create",
                     "emoji":false
                  },
                  "actionId":"dc862121-7b75-11eb-9a12-b98309fc6d2e"
               },
               ...
               "blocks":[
                  {
                     "type":"input",
                     "blockId":"poll",
                     "element":{
                        "type":"plain_text_input",
                        "initialValue":"this is a poll",
                        "actionId":"question"
                     },
                     "label":{
                        "type":"plain_text",
                        "text":"Insert your question",
                        "emoji":false
                     },
                     "appId":"c33fa1a6-68a7-491e-bf49-9d7b99671c48"
                  },
                 ...
             ],
             "appId":"c33fa1a6-68a7-491e-bf49-9d7b99671c48"
         }
     );

Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant