Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
6694 stevensc 1
import React from 'react'
2
import { useForm } from 'react-hook-form'
3
 
4
const SearchInput = () => {
5
  const { handleSubmit, register } = useForm()
6
 
7
  const handleOnSubmit = (data) => {
8
    window.location.replace(`/search/entity/user?keyword=${data.keyword}`)
9
  }
10
 
11
  return (
12
    <div className="searchInputContainer">
13
      <form onSubmit={handleSubmit(handleOnSubmit)}>
14
        <input
15
          type="text"
16
          id="keyword"
17
          name="keyword"
18
          placeholder="Buscar"
19
          ref={register}
20
        />
21
        <button type="submit">
22
          <i className="la la-search" />
23
        </button>
24
      </form>
25
    </div>
26
  )
27
}
28
 
29
export default SearchInput