-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from nvcnvn/master
add date-time option for easy testing conditional-turn-restriction
- Loading branch information
Showing
8 changed files
with
139 additions
and
15,079 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import { Input, Dropdown } from 'semantic-ui-react' | ||
|
||
export const DateTimePicker = ({ type, value, onChange }) => { | ||
return ( | ||
<div className="pa2 flex flex-wrap justify-between"> | ||
<Dropdown | ||
clearable | ||
options={[ | ||
{ | ||
key: 0, | ||
text: 'Nonspecific time', | ||
value: -1, | ||
}, | ||
{ | ||
key: 1, | ||
text: 'Leave now', | ||
value: 0, | ||
}, | ||
{ | ||
key: 2, | ||
text: 'Depart at', | ||
value: 1, | ||
}, | ||
{ | ||
key: 3, | ||
text: 'Arrive at', | ||
value: 2, | ||
}, | ||
]} | ||
selection | ||
defaultValue={type} | ||
style={{ marginLeft: '3px' }} | ||
onChange={(e, data) => { | ||
onChange('type', data.value) | ||
}} | ||
/> | ||
<Input placeholder="Search..." style={{ marginLeft: '3px' }}> | ||
<input | ||
type="datetime-local" | ||
value={value} | ||
onChange={(e) => onChange('value', e.target.value)} | ||
disabled={type < 0} | ||
/> | ||
</Input> | ||
</div> | ||
) | ||
} | ||
|
||
DateTimePicker.propTypes = { | ||
type: PropTypes.number, | ||
value: PropTypes.string, | ||
onChange: PropTypes.func, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters