-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Storybook: Add DateTimePicker #22024
Conversation
Size Change: +7.87 kB (0%) Total Size: 833 kB
ℹ️ View Unchanged
|
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 is overlap between this and #22043.
As part of fixing a bug, that one adds the DateTimePicker
to the storybook. But it also adds TimePicker
and DatePicker
as separate isolated components. Difference in this one is the use of state. Perhaps we can combine the two?
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.
This is looking great, thank you for your work! One very minor change, if you could move the const is12Hour
to the _default()
function, and then in DateTimePickerWithState
accept and pass on props to <DateTimePicker>
. (If that doesn't make sense take a look at the checkbox-control story for an example of what I mean.)
To be clear, this will function the same as your code. The only reason for the change is it makes it more clear to end-users in storybook what is happening when viewing the code in the docs panel. Otherwise, all they see is <DateTimePickerWithState />
:
@brentswisher this makes sense. after my update: |
I have just discovered that the same story was added in another PR: gutenberg/packages/components/src/date-time/stories/index.js Lines 21 to 36 in 29bb0e6
Let's close this PR. @marekhrabe, it looks like you landed 😄 |
Description
Adds a simple story for the
DateTimePicker
.How has this been tested?
In the storybook,
npm run storybook:dev
Screenshots
Types of changes
New feature (non-breaking change which adds functionality)