sungjin

End all search feature

......@@ -2,7 +2,7 @@ import {
HomeIcon,
SearchIcon,
UserIcon,
CubeIcon,
TerminalIcon,
MailIcon,
StarIcon
} from "@heroicons/react/outline"
......@@ -17,13 +17,13 @@ function Header() {
<header className="flex flex-col sm:flex-row m-5 mt-0 pt-5 justify-between items-center">
<Link href="/" passHref>
<div className="flex cursor-pointer transform hover:scale-105">
<CubeIcon className="h-20" />
<TerminalIcon className="h-20" />
<p className="text-7xl font-extrabold" >Learn In Web</p>
</div></Link>
<div className="flex flex-grow justify-evenly max-w-sm">
<HeaderItem title='HOME' Icon={HomeIcon} link="/" />
<HeaderItem title='STAR' Icon={StarIcon} link="/" />
<HeaderItem title='SEARCH' Icon={SearchIcon} link="/" />
<HeaderItem title='SEARCH' Icon={SearchIcon} link="/search/" />
<HeaderItem title='ACCOUNT' Icon={UserIcon} link="/" />
<Islogin />
</div>
......
import { searchPost } from "../api/post/post";
import { useState } from "react";
import { SearchIcon } from "@heroicons/react/outline";
export default function Search() {
const handleSubmit = async (e) => {
const handleSubmit = async (e) => {
e.preventDefault();
const search = await searchPost(e.target.search.value);
console.log(search)
......@@ -12,13 +13,15 @@ export default function Search() {
const [result, setResult] = useState([]);
return (
<div>
<div className=" ml-10 mr-10">
<form onSubmit={handleSubmit}>
<input name="search" id="search" placeholder="Search Something..."></input>
<button type="submit">Search</button>
<input name="search" id="search" placeholder="Search Something..." className="w-[90%] h-10 text-xl"></input>
<button type="submit">
<SearchIcon className="h-10 ml-2 -mb-3 rounded-full border-black border-2 p-1" />
</button>
</form>
<div>
<h1>Search Result</h1>
<h1 className="text-2xl font-bold">Search Result</h1>
{result.map((post) => {
return (
<div>
......