diff --git a/src/components/contentDisplay/searchList/SearchList.tsx b/src/components/contentDisplay/searchList/SearchList.tsx index 6b3c3d62..81d6a315 100644 --- a/src/components/contentDisplay/searchList/SearchList.tsx +++ b/src/components/contentDisplay/searchList/SearchList.tsx @@ -3,6 +3,7 @@ import { useState } from "react"; import PostSearchContainer from "@/containers/search/PostSearchContainer"; import UserSearchContainer from "@/containers/search/UserSearchContainer"; +import { useSession } from "next-auth/react"; interface Props { query: string; @@ -11,22 +12,31 @@ interface Props { export default function SearchList(props: Props) { const { query } = props; const [currenTab, setCurrentTab] = useState<"posts" | "users">("posts"); + const { data: session } = useSession(); const handleTabChange = (tab: "posts" | "users") => { setCurrentTab(tab); }; + const onSearchPost = (query: string) => { + if (query.trim() === "from:me" && session?.user.handle) { + return `from:${session.user.handle}`; + } + + return query; + }; + return (
- {currenTab === "posts" && } + {currenTab === "posts" && ( + + )} {currenTab === "users" && }
); diff --git a/src/containers/search/PostSearchContainer.tsx b/src/containers/search/PostSearchContainer.tsx index 89c2d11c..5b869562 100644 --- a/src/containers/search/PostSearchContainer.tsx +++ b/src/containers/search/PostSearchContainer.tsx @@ -57,7 +57,7 @@ export default function PostSearchContainer(props: Props) { ))} {isEmpty && !hasNextPage && ( -
+
)}