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
fix: list item component to take children and add const assertion to colors #2337
Conversation
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.
Nice work, left a comment for consideration!
{children} | ||
</Text> | ||
) : ( | ||
children |
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.
Looks good, do we need any View styling around this or should we just let the user take care of that with what they're passing in?
$textStyles has some styling associated with it that we'd be missing here.
If we do add that wrapper though, then we'd need some sort of container override, so maybe better not to.
Thoughts?
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 think it makes more sense to just let the user style the children directly. The original issue the client had with this component was that $textStyles
unintuitively styled the children being passed in so they were trying all sorts of different styles and getting unexpected results. I have a low gafo on this but I think adding additional styling would just result in the same issue.
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.
@kateinkim Sounds good to me!
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.
There's a potential deprecation here with not allowing to pass other Text children into the (Text's are meant to be nestable here). I'm wondering if there's a better way to check what type children
is without adding another prop... Thinking...
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 can just leave this PR for adding const assertion to the color palette and open an issue for the ListItem?
@kateinkim do you want to remove the ListItem change for now and leave the color change? I'm going to publish an update with a few other changes so we can lump this one in with those |
Yep! sounds good 👍🏼 |
## [8.4.5](v8.4.4...v8.4.5) (2023-01-03) ### Bug Fixes * **cli:** fixed frontmatter clean up in generate cmd ([#2328](#2328) by [@joshuayoes](https://github.com/joshuayoes) and [@frankcalise](https://github.com/frankcalise)) ([f4788f9](f4788f9)) * list item component to take children and add const assertion to colors ([#2337](#2337) by [@kateinkim](https://github.com/kateinkim)) ([7bdcec3](7bdcec3)) * **boilerplate:** updated web drawer layout width ([#2342](#2342) by [@frankcalise](https://github.com/frankcalise)) ([58de713](58de713)) * **screens:** ErrorBoundary invalid should update ([#2323](#2323) by [@tschai-yim](https://github.com/tschai-yim)) ([3952b69](3952b69))
🎉 This PR is included in version 8.4.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Describe your PR
ListItem
component, they had issues since the ListItem component was wrapping the children with the Text component with default styling which was messing up the alignment of the list. This PR gives the component more flexibility when it needs to take children without tx or text. Recreated the issue below and shows after the fix: