Skip to content
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 <TimePicker> to function component #24348

Merged

Conversation

kevin940726
Copy link
Member

@kevin940726 kevin940726 commented Aug 4, 2020

Description

Refactor to function component following the latest best practices. Related to #22890. Notable changes are as follow.

How has this been tested?

Several ways to test this:

  1. Run the storybook and play with it in components/TimePicker.
  2. Run the dev environment and play with it in the <PostSchedule> component when editing a post and scheduling post time.
  3. Run the unit tests.

Types of changes

New feature

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@kevin940726 kevin940726 added [Type] Code Quality Issues or PRs that relate to code quality [Package] Components /packages/components Storybook Storybook and its stories for components labels Aug 4, 2020
@kevin940726 kevin940726 force-pushed the update/time-picker-function-component branch from f0071c5 to ba0bdbf Compare August 4, 2020 08:38
@kevin940726 kevin940726 changed the title Update/time picker function component Refactor <TimePicker> to function component Aug 4, 2020
Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be working really nicely, appreciate all the effort into changing the tests over to react testing library, and adding the story.

I spotted one bug with the month select, though as far as I can tell it also seems to happen in master, so it may be worth taking a look at in a separate PR.

A few separate code quality things, but nothing major 😄

packages/components/src/date-time/time.js Outdated Show resolved Hide resolved
packages/components/src/date-time/time.js Show resolved Hide resolved
packages/components/src/date-time/time.js Outdated Show resolved Hide resolved
packages/components/src/date-time/time.js Outdated Show resolved Hide resolved
packages/components/src/date-time/time.js Outdated Show resolved Hide resolved
Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the work on this!

@talldan talldan merged commit 23b5b8f into WordPress:master Aug 14, 2020
@github-actions github-actions bot added this to the Gutenberg 8.8 milestone Aug 14, 2020
@kevin940726 kevin940726 deleted the update/time-picker-function-component branch August 14, 2020 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components Storybook Storybook and its stories for components [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants