-
Notifications
You must be signed in to change notification settings - Fork 0
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(Buttons): Add destructive styles #196
Conversation
9bfa70f
to
d784a81
Compare
import { AbstractButton, getButtonTypeStyles } from './abstract-button'; | ||
|
||
type ButtonType = 'primary' | 'secondary' | 'tertiary'; | ||
type ButtonType = 'primary' | 'secondary' | 'tertiary' | 'destructive'; |
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.
ButtonType
est dupliqué dans AbstractButton
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.
Je fais ça car react-docgen transfert pas les typings via les imports. Ça donne ça dans le Storybook:
C'est un problème qui perdure depuis un moment dans cette lib
reactjs/react-docgen#352 (comment)
`; | ||
} | ||
}} | ||
${getButtonTypeStyles} |
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.
Ici aussi, ButtonProps duplique buttonType
, inversed
et theme
de AbstractButton au lieu de composer son interface avec.
import { AbstractButton, AbstractButtonProps } from './abstract-button'; | ||
import { AbstractButton, getButtonTypeStyles } from './abstract-button'; | ||
|
||
type ButtonType = 'primary' | 'secondary' | 'tertiary' | 'destructive'; |
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.
Même commentaires pour icon-button
Ah, et oublie pas de rebaser, sinon ça va 💥 |
b9b7223
to
cbaf2d0
Compare
cbaf2d0
to
26b3f5e
Compare
PR Description
Ce PR ajoute le bouton destructif pour les components
IconButton
etButton
. J'ai profité de l'occasion pour refactor les styles des boutons qui étaient les même dans les deux components. J'ai ajouté la fonctiongetButtonTypeStyles()
dans le fileabstract-button.tsx
pour garder ça DRY.Carte Jira
Questionnement
Les styles sont déjà testés dans les snapshots de
Button
, donc je me demande si je retire les snapshot tests de styles pour `IconButton?Tests concernés
icon-button.test.tsx
:Has disabled styles
Has primary styles
Has secondary styles
Has tertiary styles