Improve lookbook button component preview with icon
What does this MR do and why?
This is very small fix for one of our Lookbook ViewComponent previews. Before this change, when previewing the button component, you had to type in a valid icon name by hand if you wanted to see the button with a different icon. But a wrong icon name or even an empty field made the preview raise an error. Now it uses a selectbox with a couple if icons and the option to preview buttons without any icon.
This is the exact same approach we took already for our badges component preview.
How to set up and validate locally
- Visit http://gdk.test:3000/rails/lookbook/inspect/pajamas/button/default?icon=tanuki
- Open the Params tab in the drawer (either on the right or bottom of your screen).
- Change the icon by selecting a different one from the new Icon selectbox.
- Set it to no icon by selecting the empty select option.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Thomas Hutterer