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

Refactor status chips into multiple variants of single base chip #873

Open
swouf opened this issue May 24, 2024 · 0 comments
Open

Refactor status chips into multiple variants of single base chip #873

swouf opened this issue May 24, 2024 · 0 comments
Labels
apps 📱 Relates to apps refactor

Comments

@swouf
Copy link
Contributor

swouf commented May 24, 2024

Nice PR ! It looks good to me 🚀. I just have a question: do you think it could be interesting to have a StatusChip component who have the same props as the others, but with a colour and an icon in addition ? This could allows to reuse this component inside Required, Saved and SubmittedChip component and reducing the little code duplication. Maybe it is not what we want, it is just a question 😉.

Posted by @ReidyT

@ReidyT @swouf I agree, we could have a single component that exposes a variant prop that could take the required | submitted | saved values and then simply switch on them in the component. The structure could be the same and you only have to switch on the color and icon properties. You can put them in a dictionary that indexes over the custom chip variant.

But as Thibault has said, do this only if re-use is important.

Originally posted by @spaenleh in #872 (review)

@swouf swouf added refactor apps 📱 Relates to apps labels May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apps 📱 Relates to apps refactor
Projects
None yet
Development

No branches or pull requests

1 participant