import React, {Component} from 'react';
import ReactDOM from 'react-dom';

export default class BrowserAddressBar extends React.Component {
  constructor(props){
    super(props);
    this.handleSubmit=this.handleSubmit.bind(this);
  }
  handleSubmit(e){
    e.preventDefault()
    console.log(this.refs.searchbartext.value);
    this.props.onSubmit(this.refs.searchbartext.value);
  }
  render() {
    return (
      <div>
          <form onSubmit={this.handleSubmit}>
            <input id="address-bar" type="text" ref="searchbartext" placeholder="Enter Your URL Here"/>
            <span id="input_img" className="glyphicon glyphicon-search"></span>
          </form>
      </div>
    );
  }
}
