MyCrypto/common/components/ScheduleTimestampField.tsx
Joseph Bagaric c6ec79a31b [FEATURE] Timestamp scheduling
* Scheduling: Basic date and time widget

* Linting fixes

* Moved the datetime field to new tab

* Fixed push errors

* Added missing specs

* Undid unintentional UI change

* Fixed some failing tests

* Ignore datetime parameter when checking if a transaction is full

* Added a date selector widget and renamed ScheduleTimestamp to ScheduleDate

* Marked componentDidMount

* Initialized Pikaday

* Revert "Initialized Pikaday"

This reverts commit 4e5bf5b2b882f236f5977400abf9b7092cbd1592.

* Revert "Marked componentDidMount"

This reverts commit 85d52192ac58f4b6ca9219e702f7390cd27e582f.

* Revert "Added a date selector widget and renamed ScheduleTimestamp to ScheduleDate"

This reverts commit aaad0ac9b565a78d1bfc631754160919fd38a59b.

* Converted the date picker into a datetime picker

* Added decent styling to the datetimepicker

* Added validation to the datetime picker

* Fixed prepush errors for scheduling timestamp

* Adjusted validation logic scheduling timestamp
2018-04-06 15:55:40 +07:00

29 lines
914 B
TypeScript

import React from 'react';
import translate from 'translations';
import { ScheduleTimestampFieldFactory } from './ScheduleTimestampFieldFactory';
interface Props {
isReadOnly?: boolean;
}
export const ScheduleTimestampField: React.SFC<Props> = ({ isReadOnly }) => (
<ScheduleTimestampFieldFactory
withProps={({ currentScheduleTimestamp, isValid, onChange, readOnly }) => (
<div className="input-group-wrapper">
<label className="input-group">
<div className="input-group-header">{translate('SCHEDULE_timestamp')}</div>
<input
className={`input-group-input ${isValid ? '' : 'invalid'}`}
type="text"
value={currentScheduleTimestamp.raw}
readOnly={!!(isReadOnly || readOnly)}
spellCheck={false}
onChange={onChange}
id="datepicker"
/>
</label>
</div>
)}
/>
);