From 509cef0564eb62e38c28e38c5fb796f42455f4b7 Mon Sep 17 00:00:00 2001 From: kimsayhi Date: Wed, 14 Aug 2024 19:42:52 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix=20:=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/article.ts | 4 +-- components/boards/Article.tsx | 2 +- components/boards/ArticleList.tsx | 8 ++--- components/boards/BestArticle.tsx | 2 +- components/boards/BestArticleList.tsx | 17 ++++------ hooks/useArticles.tsx | 4 +-- hooks/usePageSize.tsx | 49 ++++++++++++++------------- {models => types}/article.ts | 2 +- 8 files changed, 42 insertions(+), 46 deletions(-) rename {models => types}/article.ts (94%) diff --git a/apis/article.ts b/apis/article.ts index 04f3e46d4..cb7246cd6 100644 --- a/apis/article.ts +++ b/apis/article.ts @@ -1,6 +1,6 @@ import axios from "@/lib/axios"; -import { ArticleQuery } from "@/models/article"; -import { ArticleResponse } from "@/models/article"; +import { ArticleQuery } from "@/types/article"; +import { ArticleResponse } from "@/types/article"; export const getArticleList = async ({ page = 1, diff --git a/components/boards/Article.tsx b/components/boards/Article.tsx index 94a38468e..35bd1311b 100644 --- a/components/boards/Article.tsx +++ b/components/boards/Article.tsx @@ -1,6 +1,6 @@ import Image from "next/image"; import { formatDate } from "@/utils/formatDate"; -import type { Article } from "@/models/article"; +import type { Article } from "@/types/article"; import icHeart from "@/public/images/ic_heart.svg"; import icProfile from "@/public/images/ic_profile.svg"; diff --git a/components/boards/ArticleList.tsx b/components/boards/ArticleList.tsx index d7e7f368f..3dd4be137 100644 --- a/components/boards/ArticleList.tsx +++ b/components/boards/ArticleList.tsx @@ -21,7 +21,7 @@ export default function ArticleList() { const [nowOrderBy, setNowOrderBy] = useState(INIT_ORDERS.recent); const [isOpenDropDown, setIsOpenDropDown] = useState(false); - const onClickDropDown = () => { + const toggleDropDown = () => { setIsOpenDropDown((prev) => !prev); }; @@ -32,7 +32,7 @@ export default function ArticleList() { orderBy: orderBy, })); setNowOrderBy(INIT_ORDERS[orderBy]); - setIsOpenDropDown((prev) => !prev); + toggleDropDown(); }; let debounceTimer: NodeJS.Timeout; @@ -69,14 +69,14 @@ export default function ArticleList() {