Skip to content

Commit

Permalink
Refactor <TimePicker> to function component (#24348)
Browse files Browse the repository at this point in the history
* Refactor tests to use RTL

* Add test for ordering of the month/day input

* Add storybook for <TimePicker>

* Refactor <TimePicker>

* Coding style updates as per suggested in code reviews
  • Loading branch information
kevin940726 authored Aug 14, 2020
1 parent 5171c2e commit 23b5b8f
Show file tree
Hide file tree
Showing 4 changed files with 423 additions and 1,116 deletions.
26 changes: 26 additions & 0 deletions packages/components/src/date-time/stories/time.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Internal dependencies
*/
import TimePicker from '../time';

/**
* External dependencies
*/
import { date, boolean } from '@storybook/addon-knobs';
import { noop } from 'lodash';

export default { title: 'Components/TimePicker', component: TimePicker };

export const _default = () => {
return (
<TimePicker
currentTime={
new Date(
date( 'currentTime', new Date( '1986-10-18T11:00:00' ) )
)
}
is12Hour={ boolean( 'is12Hour', false ) }
onChange={ noop }
/>
);
};
Loading

0 comments on commit 23b5b8f

Please sign in to comment.