-
Notifications
You must be signed in to change notification settings - Fork 4
Add #435: Storybook stories for Progress component #536
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
base: develop
Are you sure you want to change the base?
Conversation
Before: No Story in place for Progress component as part of issue #435 After: Create Empty, Halfway and Full Progress stories showcasing different progress values Includes interactive controls for value, className and indicatorClassName. Issue: Progress bar renders utilizing a parent component however this comes with an 'error' that I am still figuring out
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Removed cn import as it is not needed
stories/Progress.stories.tsx
Outdated
| @@ -0,0 +1,59 @@ | |||
| import type { Meta, StoryObj } from '@storybook/react'; | |||
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.
Add headers.
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.
Headers have been added
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.
Just add a newline after the headers to fix the eslint error.
stories/Progress.stories.tsx
Outdated
| args: { | ||
| value: 0, | ||
| }, | ||
| render: (args) => ( |
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.
Look up decorators in Storybook. This is a way to add a wrapper to the element so you can wrap each Progress in a div.
Then you can remove all the renders you have in each export.
https://storybook.js.org/docs/writing-stories/decorators
If it complains about a missing return type, import and use ReactElement. There might be a better type, but I found this works.
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 have implemented decorators and removed or renders for the individual examples
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 still a missing return type on the decorator. Use import { ReactElement } from 'react'; instead of importing all of React.
Then use ReactElement as the decorator's return type.
|
Move the story file into the Progress component's folder.
|
add 'react' import
nickytonline
left a comment
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.
🚢
Before: No Story in place for Progress component as part of issue #435
After:
Issue: Progress bar renders utilizing a parent component however this comes with an 'error' that I am still figuring out.