From 6669fec69a0f58196424ea6f4d9f61258996d124 Mon Sep 17 00:00:00 2001 From: hamo-o Date: Sun, 3 Sep 2023 06:01:39 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20mypage=20UI=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/GridWrapper/index.tsx | 1 + src/pages-edit/mypage/Mypage.tsx | 4 ++-- src/pages-edit/mypage/components/ButtonQfeedSelect.tsx | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/GridWrapper/index.tsx b/src/components/GridWrapper/index.tsx index 4b809a6..fd04851 100644 --- a/src/components/GridWrapper/index.tsx +++ b/src/components/GridWrapper/index.tsx @@ -34,6 +34,7 @@ const QuestionGrid = (data: Questions) => { }; const GridWrapper = styled(motion.div)` + width: 100%; display: flex; gap: 12px; align-items: start; diff --git a/src/pages-edit/mypage/Mypage.tsx b/src/pages-edit/mypage/Mypage.tsx index 891243f..525e2e1 100644 --- a/src/pages-edit/mypage/Mypage.tsx +++ b/src/pages-edit/mypage/Mypage.tsx @@ -18,8 +18,8 @@ export default function Mypage() { {isLoading ? ( ) : ( - - + + Date: Sun, 3 Sep 2023 11:39:37 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=EC=BF=BC=EB=A6=AC=ED=82=A4=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Title/BackTitle.tsx | 2 +- src/constants/queryKeys/questionKeys.ts | 5 ++++- src/hooks/questions/useGetUserQQuery.ts | 2 +- src/pages-edit/friend/Friend.tsx | 2 +- src/pages-edit/home/Home.tsx | 2 +- src/pages-edit/home/components/MakeOfficial.tsx | 7 ++++--- src/pages-edit/mypage/components/ButtonQfeedSelect.tsx | 2 -- 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/components/Title/BackTitle.tsx b/src/components/Title/BackTitle.tsx index 638a5b9..f1e8ad3 100644 --- a/src/components/Title/BackTitle.tsx +++ b/src/components/Title/BackTitle.tsx @@ -49,7 +49,7 @@ const BackTitle = forwardRef(function Div( )} - + {/* */} ) : null} diff --git a/src/constants/queryKeys/questionKeys.ts b/src/constants/queryKeys/questionKeys.ts index 70a07f5..c83bcd1 100644 --- a/src/constants/queryKeys/questionKeys.ts +++ b/src/constants/queryKeys/questionKeys.ts @@ -1,6 +1,9 @@ +import { Qtype } from "src/models/questions"; + export const questionKeys = { all: ["question"] as const, - detail: (id: number) => [...questionKeys.all, id] as const + detail: (id: number, qtype: Qtype) => + [...questionKeys.all, id, qtype] as const }; export const QSetCursorKeys = { diff --git a/src/hooks/questions/useGetUserQQuery.ts b/src/hooks/questions/useGetUserQQuery.ts index ba92fdf..5f7c31b 100644 --- a/src/hooks/questions/useGetUserQQuery.ts +++ b/src/hooks/questions/useGetUserQQuery.ts @@ -10,7 +10,7 @@ const useGetUserQQuery = (id: number, qtype: Qtype) => { isLoading, refetch } = useQuery( - questionKeys.detail(id), + questionKeys.detail(id, qtype), () => getUserQuestions(id, qtype), { onError: (error: any) => { diff --git a/src/pages-edit/friend/Friend.tsx b/src/pages-edit/friend/Friend.tsx index b16bf7d..9634222 100644 --- a/src/pages-edit/friend/Friend.tsx +++ b/src/pages-edit/friend/Friend.tsx @@ -22,7 +22,7 @@ import { enterComponentVariants } from "src/constants/animation"; export default function Mypage() { const router = useRouter(); - const search = useInput(); + const search = useInput(""); const searchResult = useUsersQuery(search.value); useEffect(() => { diff --git a/src/pages-edit/home/Home.tsx b/src/pages-edit/home/Home.tsx index 04d19c9..e63bf19 100644 --- a/src/pages-edit/home/Home.tsx +++ b/src/pages-edit/home/Home.tsx @@ -62,7 +62,7 @@ export default function Home() { - + {/* */} {isLoading ? <> : data && } {isLoading ? ( diff --git a/src/pages-edit/home/components/MakeOfficial.tsx b/src/pages-edit/home/components/MakeOfficial.tsx index a46d6b3..ca42527 100644 --- a/src/pages-edit/home/components/MakeOfficial.tsx +++ b/src/pages-edit/home/components/MakeOfficial.tsx @@ -36,11 +36,12 @@ const MakeOfficial = (props: QuestionProps) => { const getTime = () => { const date = new Date(); - if (!isNaN(endTime) && +date > endTime + 24 * 60 * 60 * 1000) { + const times = new Date(endTime + 24 * 60 * 60 * 1000 - +date); + + if (+times <= 0) { newQSet.mutate(); } - const times = new Date(endTime + 24 * 60 * 60 * 1000 - +date); const hours = String(times.getHours()).padStart(2, "0"); const minutes = String(times.getMinutes()).padStart(2, "0"); const seconds = String(times.getSeconds()).padStart(2, "0"); @@ -70,7 +71,7 @@ const MakeOfficial = (props: QuestionProps) => { {time ? `${time.hour}:${time.min}:${time.sec}` - : ""} + : "00:00:00"} {/* Date: Sun, 3 Sep 2023 11:45:37 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20question=20detail=20=EC=BF=BC?= =?UTF-8?q?=EB=A6=AC=ED=82=A4=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/queryKeys/questionKeys.ts | 5 +++-- src/hooks/questions/useGetUserQQuery.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/constants/queryKeys/questionKeys.ts b/src/constants/queryKeys/questionKeys.ts index c83bcd1..c039e02 100644 --- a/src/constants/queryKeys/questionKeys.ts +++ b/src/constants/queryKeys/questionKeys.ts @@ -2,8 +2,9 @@ import { Qtype } from "src/models/questions"; export const questionKeys = { all: ["question"] as const, - detail: (id: number, qtype: Qtype) => - [...questionKeys.all, id, qtype] as const + qtype: (id: number, qtype: Qtype) => + [...questionKeys.all, id, qtype] as const, + detail: (id: number) => [...questionKeys.all, id] as const }; export const QSetCursorKeys = { diff --git a/src/hooks/questions/useGetUserQQuery.ts b/src/hooks/questions/useGetUserQQuery.ts index 5f7c31b..f0421be 100644 --- a/src/hooks/questions/useGetUserQQuery.ts +++ b/src/hooks/questions/useGetUserQQuery.ts @@ -10,7 +10,7 @@ const useGetUserQQuery = (id: number, qtype: Qtype) => { isLoading, refetch } = useQuery( - questionKeys.detail(id, qtype), + questionKeys.qtype(id, qtype), () => getUserQuestions(id, qtype), { onError: (error: any) => {