오늘 고민한 것, 적용한 것들 정리
import SearchIcon from "./icons/SearchIcon";
export default function SearchBar() {
return (
<div className="flex justify-center items-center p-3 rounded-3xl transition-all duration-500 sm:w-10 md:w-[300px] md:border">
<button className="text-xl ">
<SearchIcon />
</button>
<input
type="text"
className="outline-none w-full hidden md:block md:ml-2"
/>
</div>
);
}
"use client";
import { RiHomeFill } from "@react-icons/all-files/ri/RiHomeFill";
import { RiSearchLine } from "@react-icons/all-files/ri/RiSearchLine";
import { RiUserLine } from "@react-icons/all-files/ri/RiUserLine";
import { RiNotificationLine } from "@react-icons/all-files/ri/RiNotificationLine";
import { useState } from "react";
import Link from "next/link";
import { useSession } from "next-auth/react";
export default function BottomNavBar() {
const [activeTab, setActiveTab] = useState("home");
const { data: session } = useSession();
const user = session?.user;
return (
<div className="fixed inset-x-0 bottom-0 border-t bg-white text-gray-400 flex justify-around items-center py-2 z-50 sm:hidden">
<Link href="/">
<button
onClick={() => setActiveTab("home")}
className={activeTab === "home" ? "text-black" : ""}
>
<RiHomeFill className="h-6 w-6" />
<span className="text-xs">홈</span>
</button>
</Link>
<Link href="/search">
<button
onClick={() => setActiveTab("search")}
className={activeTab === "search" ? "text-black" : ""}
>
<RiSearchLine className="h-6 w-6" />
<span className="text-xs">검색</span>
</button>
</Link>
<Link href="/notification">
<button
onClick={() => setActiveTab("notification")}
className={activeTab === "notification" ? "text-black" : ""}
>
<RiNotificationLine className="h-6 w-6" />
<span className="text-xs">알림</span>
</button>
</Link>
<Link href={`/user/${user?.id}`}>
<button
onClick={() => setActiveTab("profile")}
className={`${
activeTab === "profile" ? "text-black" : ""
} flex flex-col items-center`}
>
<RiUserLine className="h-6 w-6" />
<span className="text-xs">마이</span>
</button>
</Link>
</div>
);
}



const handleOnChange = (e: ChangeEvent<HTMLInputElement>) => {
const { name, value } = e.target;
setFormData((prev) => ({
...prev,
[name]: value,
}));
setErrorMessage("");
};
<div className="flex w-full items-center justify-center my-4">
<hr className="border-t border-gray-300 flex-grow" />
<span className="mx-4 text-gray-500">OR</span>
<hr className="border-t border-gray-300 flex-grow" />
</div>

