-
Notifications
You must be signed in to change notification settings - Fork 142
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(StringFormatter): new component StringFormatter #4249
feat(StringFormatter): new component StringFormatter #4249
Conversation
updated css Updated DefinitionTooltip import (incorrect name) Small changes to V11 component Minor changes to proptype comments Added overrides for tooltip overlay size and position
✅ Deploy Preview for carbon-for-ibm-products ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Modified things for the stories.
Added description to the component Updated the docs mdx page
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.
export let StringFormatter = React.forwardRef( | ||
( | ||
{ | ||
// The component props, in alphabetical order (for consistency). |
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.
same comment as before about cleaning up comments
ref={ref} | ||
{ | ||
// Pass through any other property values as HTML attributes. | ||
...rest |
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.
prop spreading should always be first in order to avoid the user possibly overwriting them
* Only used internally | ||
*/ | ||
|
||
let StringFormatterContent = React.forwardRef( |
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.
as a general convention we should always separate components into their own files. this seems small enough that i don't think it's strictly necessary to have it's own dedicated file. i think this code could just be lumped back into StringFormatter
. either way is completely fine.
Put subcomponent into its own file
Yep, this thing should just inherit the line height, color - that kinda stuff from its parent or be set with a class or something. I think for the stories we just did body-01 type style and a text-primary color |
74d67d0
Contributes to issue 4224
Migrate StringFormatter from
Products v1 / Security / StringFormatter
to Products v2 asStringFormatter
.v1
References: GitHub, Storybook.What did you change?
How did you test and verify your work?