Commit 1f3acca1 authored by Kim, Subin's avatar Kim, Subin
Browse files

Search component 수정

parent a7e6bbcf
import styles from "./search.module.scss"; import styles from "./search.module.scss";
const Search = ({ type, search, setSearch, handleClick }) => { const Search = ({ search, setSearch, handleClick }) => {
function handleSearch(e) { function handleSearch(e) {
const { name, value } = e.target const { name, value } = e.target
setSearch({ ...search, [name]: value }) setSearch({ ...search, [name]: value })
} }
console.log("type==", type)
return ( return (
<div className="d-flex"> <div className="d-flex">
{type === "home" ? null : <input className={`form-control ${search.type === "home" ? styles.searchWhite : `${styles.search}`}`} name="keyword" type="text" autoComplete="off" onChange={handleSearch} />
<select className={`form-select ${styles.search}`} name="kind" aria-label="select search" onChange={handleSearch}> <i className={`bi bi-search align-self-center ${search.type === "home" ? "text-white" : "mx-2"} ${styles.icon}`} onClick={handleClick} style={{ fontSize: "1.3rem" }}></i>
<option value="title">제목</option>
<option value="director">감독명</option>
</select>
}
<input className={`form-control ${type === "home" ? styles.searchWhite : `${styles.search}`}`} name="keyword" type="text" autoComplete="off" onChange={handleSearch} />
<i className={`bi bi-search align-self-center ${type === "home" ? "text-white" : "mx-2"} ${styles.icon}`} onClick={handleClick} style={{ fontSize: "1.3rem" }}></i>
</div> </div>
) )
} }
......
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