insomnia/app/components/UrlInput.js

33 lines
893 B
JavaScript
Raw Normal View History

2016-03-20 23:20:00 +00:00
import React, {Component, PropTypes} from 'react'
import Input from '../components/Input';
class UrlInput extends Component {
render () {
2016-03-20 23:27:46 +00:00
const {onUrlChange, urlValue, method} = this.props;
2016-03-20 23:20:00 +00:00
return (
<div className="grid">
<button className="btn method-dropdown">
2016-03-20 23:27:46 +00:00
{method}&nbsp;&nbsp;<i className="fa fa-caret-down"></i>
2016-03-20 23:20:00 +00:00
</button>
<Input type="text"
placeholder="https://google.com"
initialValue={urlValue}
onChange={onUrlChange}/>
<button className="btn send-request-button">
<i className="fa fa-repeat txt-xl"></i>
</button>
</div>
)
}
}
UrlInput.propTypes = {
onUrlChange: PropTypes.func.isRequired,
2016-03-20 23:27:46 +00:00
onMethodChange: PropTypes.func.isRequired,
urlValue: PropTypes.string.isRequired,
method: PropTypes.string.isRequired
2016-03-20 23:20:00 +00:00
};
export default UrlInput;