-
Notifications
You must be signed in to change notification settings - Fork 12
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(sfint-3272): Add ToggleActionButton component #76
Conversation
Looks great! Just out of curiosity had you considered extending the ActionButton as an alternative? If yes then would you mind explaining why you went this route instead? |
Yes, and yes. By extending ActionButton, ToggleActionButton would also have to support all possible combinations of icon/title. Composition allows to implement only what is needed right now. If we ever need to have toggle buttons with text, it would be possible to add it. |
All right thanks. That was my suspicion. Well, GG! 🏆 |
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 overall,
Some changes maybe on the variable names (I'm being picky tho).
Intrigued by the test with the spy.
Très nice! J'aime bien ces petits components la :P |
C'est une bonne question, je n'y avais pas songé, mais c'est vrai que les boutons ont un comportement qui se ressemble beaucoup. Je ne sais pas si le changement pourrait se faire sans briser la compatibilité par contre. |
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!
This PR adds the ToggleActionButton component. As its name states, it simply is an ActionButton featuring a toggle state. In addition, to keep things simple, this button supports only having an icon and tooltip. A different icon and tooltip can be displayed when the button is activated.
Using the options, the caller might attach handlers when the button is either clicked, activated, or deactivated.