import React from 'react';
import 'bootstrap/dist/css/bootstrap.min.css';
import { Component } from 'react';
import {Container,Row,Col,Navbar,Nav,Button,FormControl,Form} from 'react-bootstrap';
class Navibar extends Component {
constructor(props) {
super(props);
this.state = {
term: '',
}
}
onUpdateSearch = (e) => {
const term = e.target.value;
this.setState({term});
this.props.onUpdateSearch({term})
}
render(){
console.log(this.props.onUpdateSearch)
return(
<Container>
<Row>
<Col>
<Navbar bg="light" expand="lg">
<Container fluid>
<Navbar.Brand href="/">Alcohol shop</Navbar.Brand>
<Navbar.Toggle aria-controls="navbarScroll" />
<Navbar.Collapse id="navbarScroll">
<Nav
className="me-auto my-2 my-lg-0"
style={{ maxHeight: '100px' }}
navbarScroll
>
<Nav.Link href="/ListProduct">List Product</Nav.Link>
</Nav>
<Form className="d-flex">
<FormControl
type="search"
placeholder="Search"
className="me-2"
aria-label="Search"
value ={this.state.term}
onChange ={this.onUpdateSearch}
/>
<Button variant="outline-success">Search</Button>
</Form>
</Navbar.Collapse>
</Container>
</Navbar>
</Col>
</Row>
</Container>
)
}
}
export default Navibar;
