import React, {Component, PropTypes} from 'react'; import classnames from 'classnames'; import Dropdown from './base/Dropdown'; import MethodTag from './tags/MethodTag'; import {METHODS, DEBOUNCE_MILLIS} from '../lib/constants'; import Mousetrap from '../lib/mousetrap'; import {trackEvent} from '../lib/analytics'; class RequestUrlBar extends Component { _handleFormSubmit (e) { e.preventDefault(); this.props.sendRequest(); } _handleUrlChange (url) { clearTimeout(this._timeout); this._timeout = setTimeout(() => { this.props.onUrlChange(url); }, DEBOUNCE_MILLIS); } componentDidMount () { Mousetrap.bindGlobal('mod+l', () => { this.input.focus(); this.input.select() }); } render () { const {onMethodChange, url, method} = this.props; // TODO: Implement proper error checking here const hasError = !url; return (