-
Notifications
You must be signed in to change notification settings - Fork 4k
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(Label): update props to the latest specs #486
refactor(Label): update props to the latest specs #486
Conversation
I would suspect users would want pointer cursors ( +1 to |
f7604c9
to
e363ffa
Compare
Current coverage is 98.63% (diff: 100%)@@ master #486 diff @@
==========================================
Files 101 101
Lines 1467 1465 -2
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 1447 1445 -2
Misses 20 20
Partials 0 0
|
Made the |
const ElementType = getElementType(Label, props, () => { | ||
if (image || link || onClick) return 'a' | ||
}) | ||
const DetailComponent = detailAs || 'div' |
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.
Hm. I think here we should be using getElementType()
for consistent handling. This makes me realize that this component is actually missing sub components. It should have Label.Detail
for instance. That would also solve all the issues related to it.
If you like, we can merge this as is, and open an issue to create Label sub components.
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.
+1 for merging this as-is and opening a new issue to talk about sub components.
Quick thoughts:
There are a few sub components, but only detail
can be semi-customized. The others are either there or not and are already covered by factories.
I think Label.Detail
might make sense to break out into its own component with props:
- as
- children
- content
- onClick
It'd be really nice to keep a shorthand prop on Label
for a vanilla detail, though. Can't think of an analogous component relationship off the top of my head.
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.
Definitely. See https://github.com/TechnologyAdvice/stardust/issues/488
Cool, will merge on pass. LMK what you want to do regarding sub components mentioned here |
Released in |
Addresses #474
Some comments/questions:
link
prop which set the element type toa
but there was also logic so ifimage
oronClick
was passed it would be rendered asa
. I removed that whole thing in favor of just using theas
prop. I figured the less magic the better.detail
here. Thoughts on removing that logic and thedetailLink
prop in favor of adetailAs
which would behave likeas
?