Commit d1814441 authored by Mai Thanh Cong's avatar Mai Thanh Cong

change text in search profile

parent 08f2f3d6
...@@ -33,18 +33,17 @@ import { ...@@ -33,18 +33,17 @@ import {
} from "reactstrap"; } from "reactstrap";
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import dummyData from "../../data/index.json"; import dummyData from "../../data/index.json";
import { Routes } from "../../reoutes";
const Inputs = () => { const Inputs = () => {
const [searchProfile, setSearchProfile] = useState(); const [searchProfile, setSearchProfile] = useState();
const history = useHistory(); const history = useHistory();
const handleChangeSearch = (event) => { const handleChangeSearch = (event) => {
console.log("change change");
setSearchProfile(event.target.value); setSearchProfile(event.target.value);
} }
const onHandleSearch = () => { const onHandleSearch = (event) => {
event.preventDefault();
const nameCode = dummyData.data.map(item => item.code); const nameCode = dummyData.data.map(item => item.code);
console.log("nameCode", nameCode); console.log("nameCode", nameCode);
const checkSearch = nameCode.indexOf(searchProfile); const checkSearch = nameCode.indexOf(searchProfile);
...@@ -64,13 +63,13 @@ const Inputs = () => { ...@@ -64,13 +63,13 @@ const Inputs = () => {
<section className="section pb-0 section-components"> <section className="section pb-0 section-components">
<Container className="mb-5"> <Container className="mb-5">
{/* Inputs */} {/* Inputs */}
<h3 className="h4 text-success font-weight-bold mb-4 text-center">Search profile</h3> <h3 className="h4 text-success font-weight-bold mb-4 text-center">Tra cu thông tin</h3>
{/* <div className="mb-3"> {/* <div className="mb-3">
<small className="text-uppercase font-weight-bold"> <small className="text-uppercase font-weight-bold">
Form controls Form controls
</small> </small>
</div> */} </div> */}
<Form className="justify-content-center"> <Form className="justify-content-center" onSubmit={onHandleSearch}>
<FormGroup <FormGroup
// className={classnames({ // className={classnames({
// focused: this.state.searchFocused // focused: this.state.searchFocused
...@@ -83,7 +82,7 @@ const Inputs = () => { ...@@ -83,7 +82,7 @@ const Inputs = () => {
</InputGroupText> </InputGroupText>
</InputGroupAddon> </InputGroupAddon>
<Input <Input
placeholder="Search" placeholder="Tìm kiếm"
type="text" type="text"
// onFocus={e => this.setState({ searchFocused: true })} // onFocus={e => this.setState({ searchFocused: true })}
// onBlur={e => this.setState({ searchFocused: false })} // onBlur={e => this.setState({ searchFocused: false })}
...@@ -93,8 +92,8 @@ const Inputs = () => { ...@@ -93,8 +92,8 @@ const Inputs = () => {
</InputGroup> </InputGroup>
</FormGroup> </FormGroup>
<div className="text-center"> <div className="text-center">
<Button className="btn-1" color="primary" type="button" onClick={onHandleSearch} > <Button className="btn-1" color="primary" type="submit">
Search Tìm kiếm
</Button> </Button>
</div> </div>
</Form> </Form>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment