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/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..c039e02 100644
--- a/src/constants/queryKeys/questionKeys.ts
+++ b/src/constants/queryKeys/questionKeys.ts
@@ -1,5 +1,9 @@
+import { Qtype } from "src/models/questions";
+
export const questionKeys = {
all: ["question"] as const,
+ qtype: (id: number, qtype: Qtype) =>
+ [...questionKeys.all, id, qtype] as const,
detail: (id: number) => [...questionKeys.all, id] as const
};
diff --git a/src/hooks/questions/useGetUserQQuery.ts b/src/hooks/questions/useGetUserQQuery.ts
index ba92fdf..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),
+ questionKeys.qtype(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"}
{/*
) : (
-
-
+
+