message: Redo TimePickerWrapper with BasePicker HOC
diff: @@ -3,12 +3,58 @@ import PropTypes from 'prop-types';
  import ModalWrapper from '../wrappers/ModalWrapper';
  import TimePicker from './TimePicker';
  -import PickerBase from '../_shared/PickerBase';
  import withUtils from '../_shared/WithUtils';
  import DomainPropTypes from '../constants/prop-types';
  +import BasePicker from '../_shared/BasePicker';
  -export class TimePickerWrapper extends PickerBase {
  - static propTypes = {
  +const TimePickerWrapper = (props) => {
  + const {
  + value, format, autoOk, onChange, utils, ampm, fadeTimeout, forwardedRef, ...other
  + } = props;
  +
  + return (
  + <BasePicker
  + default12hFormat="hh:mm A"
  + default24hFormat="HH:mm"
  + {...props}
  + >
  + {
  + ({
  + date,
  + handleAccept,
  + handleChange,
  + handleClear,
  + handleDismiss,
  + handleSetTodayDate,
  + handleTextFieldChange,
  + getDefaultAmPmFormat,
  + }) => (
  + <ModalWrapper
  + ref={forwardedRef}
  + value={value}
  + format={getDefaultAmPmFormat()}
  + onClear={handleClear}
  + onAccept={handleAccept}
  + onChange={handleTextFieldChange}
  + onDismiss={handleDismiss}
  + onSetToday={handleSetTodayDate}
  + {...other}
  + >
  + <TimePicker
  + date={date}
  + onChange={handleChange}
  + utils={utils}
  + ampm={ampm}
  + fadeTimeout={fadeTimeout}
  + />
  + </ModalWrapper>
  + )
  + }
  + </BasePicker>
  + );
  +};
  +
  +TimePickerWrapper.propTypes = {
  utils: PropTypes.object.isRequired,
  /** DateTimepicker value */
  value: DomainPropTypes.date,
  @@ -22,48 +68,17 @@ export class TimePickerWrapper extends PickerBase {
  ampm: PropTypes.bool,
  /** Switching hour/minutes animation timeout in milliseconds (set 0 to disable) */
  fadeTimeout: PropTypes.number,
  - }
  + forwardedRef: PropTypes.func,
  +};
  - static defaultProps = {
  +TimePickerWrapper.defaultProps = {
  value: new Date(),
  format: undefined,
  autoOk: false,
  ampm: true,
  fadeTimeout: 400,
  - }
  -
  - default12hFormat = 'hh:mm A'
  - default24hFormat = 'HH:mm'
  -
  - render() {
  - const { date } = this.state;
  - const {
  - value, format, autoOk, onChange, utils, ampm, fadeTimeout, ...other
  - } = this.props;
  -
  - return (
  - <ModalWrapper
  - ref={this.getRef}
  - value={value}
  - format={this.getFormat()}
  - onClear={this.handleClear}
  - onAccept={this.handleAccept}
  - onChange={this.handleTextFieldChange}
  - onDismiss={this.handleDismiss}
  - onSetToday={this.handleSetTodayDate}
  - {...other}
  - >
  - <TimePicker
  - date={date}
  - onChange={this.handleChange}
  - utils={utils}
  - ampm={ampm}
  - fadeTimeout={fadeTimeout}
  - />
  - </ModalWrapper>
  - );
  - }
  -}
  -
  -export default withUtils()(TimePickerWrapper);
  + forwardedRef: undefined,
  +};
  +const WithUtils = withUtils()(TimePickerWrapper);
  +export default React.forwardRef((props, ref) => <WithUtils {...props} forwardedRef={ref} />);
  