-
Notifications
You must be signed in to change notification settings - Fork 2
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: [IOBP-236] ListItemSwitch extension with loading state and badge #79
Conversation
Co-authored-by: Cristiano Tofani <cri.tofani@gmail.com>
@dmnplb I have doubt about this implementation: the badge version of the list item should be explicit of this specific list item or be took apart as a scoped component? |
For any doubts about this component, this is the figma where this component is used. I think that is overkill to create another component only to handle a badge on the right side and it will have negative effect on the DX side |
Looking to the figma you linked it could even be represented by another component (eg: A standard I would prefer to keep the |
Unfortunately, we can't use this approach because a simple So for me, extending the |
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
…g-and-badge' into IOBP-236-list-item-switch-loading-and-badge
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.
I'll approve it when the components are located in the right section of the example playground (under Selection, instead of List Items)
The suggested hint is already addressed into commit 71b2183 on Friday, please take a look at it |
@Hantex9 My bad, I forgot to pull the latest updates 😅 |
Short description
This PR adds three more props to
ListItemSwitch
component:isLoading
: while true it shows an activity indicatorbadgeText
: A text to show inside a badge instead of the switch. If it is not null, you have to provide also abadgeVariant
badgeVariant
: It indicates the badge variant to show;List of changes proposed in this pull request
badgeText
andbadgeVariant
are conditional properties;ListItemSwitch
inside example app;How to test
Open the example app, navigate through
List items
section and check the new examples:Preview
listitemswitch.mov