| 1 |
// External Dependencies |
| 2 |
import React, { Component } from 'react'; |
| 3 |
|
| 4 |
// Internal Dependencies |
| 5 |
import './style.css'; |
| 6 |
|
| 7 |
class Input extends Component { |
| 8 |
|
| 9 |
static slug = 'dedi_input'; |
| 10 |
|
| 11 |
/** |
| 12 |
* Handle input value change. |
| 13 |
* |
| 14 |
* @param {object} event |
| 15 |
*/ |
| 16 |
_onChange = (event) => { |
| 17 |
this.props._onChange(this.props.name, event.target.value); |
| 18 |
} |
| 19 |
|
| 20 |
render() { |
| 21 |
return( |
| 22 |
<input |
| 23 |
id={`dedi-input-${this.props.name}`} |
| 24 |
name={this.props.name} |
| 25 |
value={this.props.value} |
| 26 |
type='text' |
| 27 |
className='dedi-input' |
| 28 |
onChange={this._onChange} |
| 29 |
placeholder='Your text here ...' |
| 30 |
/> |
| 31 |
); |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
export default Input; |
| 36 |
|