-
Notifications
You must be signed in to change notification settings - Fork 78
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
Feat: custom user input buttons #2314
Conversation
…CUSTOM_PROPERTIES
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🤟
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with @vanbasten17 comments and also I suggest to move the custom rendering logic to the webchat.jsx
file (the same way it's done with the SendButton
component), let me know if it make sense to you.
498aff5
to
206d926
Compare
in the commit I have removed the IconContainer that is only used in this button what really changes is the padding but I think it still looks good because I have also changed the styled component UserInputContainer in de next commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go for it 🚀
1410961
to
636f127
Compare
* feat(react): add in CUSTOM_PROPERTIES customEmojiPicker and customAttachments * feat(botonic-react): render the custom component if it exists * feat(botonic-react): render the custom component if it is defined in CUSTOM_PROPERTIES * chore(botonic-react): add build:watch script * refactor(botonic-react): rename functions typo error * feat(botonic-react): create ConditionalAnimation as a component * refactor(botonic-react): put the conditional rendering logic inside each component * refactor(botonic-react): simplify the webchat component * chore(react): bump alpha version * chore(react): bump to 0.21.2 --------- Co-authored-by: Marc Rabat <marcrabat@gmail.com> Co-authored-by: Marc Rabat Pla <35448568+vanbasten17@users.noreply.github.com>
Description
This PR adds the feature to define in the bot the icons to send an emoji and attach a file as you can do with the send text button by declaring a custom component
Context
I didn't want to modify more things but I think the css should also be refactored to reduce the number of nested divs with fixed paddings to separate the elements. As you can see in the image the custom buttons are not well aligned.
Approach taken / Explain the design
To document / Usage example
Before change icons
After change icons
You can define custom components for each button like this
Testing
The pull request...