From 5c43ec39e98c83d4953b1783b7ae28d2c267e31b Mon Sep 17 00:00:00 2001 From: mandelina Date: Wed, 19 Nov 2025 23:26:02 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=ED=94=BD=ED=94=BD=ED=94=BD=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=EC=A7=80=20=EC=BD=98=ED=85=90=EC=B8=A0?= =?UTF-8?q?=EC=9D=98=20=EC=A2=8C=EC=B8=A1=EC=A0=95=EB=A0=AC=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/pickpickpick/components/PickAnswerV2.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pages/pickpickpick/components/PickAnswerV2.tsx b/pages/pickpickpick/components/PickAnswerV2.tsx index 312a25f2..4e3465bc 100644 --- a/pages/pickpickpick/components/PickAnswerV2.tsx +++ b/pages/pickpickpick/components/PickAnswerV2.tsx @@ -73,10 +73,7 @@ export default function PickAnswerV2({ if (content) { return (

{content}

From 9d60a47631c759e8cf422ecc3c9688a60d170233 Mon Sep 17 00:00:00 2001 From: mandelina Date: Wed, 19 Nov 2025 23:35:39 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=ED=94=BD=ED=94=BD=ED=94=BD=20?= =?UTF-8?q?=EA=B2=80=EC=83=89=20=ED=82=A4=EC=9B=8C=EB=93=9C=20=EB=A6=AC?= =?UTF-8?q?=EC=85=8B=EC=9D=84=20=EC=9C=84=ED=95=9C=20store=EB=8F=84?= =?UTF-8?q?=EC=9E=85=20,=20GNB=EC=97=90=EC=84=9C=20reset=EB=90=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hooks/useHandleNavClick.ts | 3 +++ pages/pickpickpick/index.page.tsx | 19 ++++++++++--------- stores/pickSearchStore.ts | 17 +++++++++++++++++ 3 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 stores/pickSearchStore.ts diff --git a/hooks/useHandleNavClick.ts b/hooks/useHandleNavClick.ts index e2548704..303d7b93 100644 --- a/hooks/useHandleNavClick.ts +++ b/hooks/useHandleNavClick.ts @@ -1,6 +1,7 @@ import { useQueryClient } from '@tanstack/react-query'; import { usePickDropdownStore, useTechblogDropdownStore } from '@stores/dropdownStore'; +import { usePickSearchStore } from '@stores/pickSearchStore'; import { useCompanyInfoStore, useSearchKeywordStore } from '@stores/techBlogStore'; import { ROUTES } from '@/constants/routes'; @@ -11,11 +12,13 @@ const useHandleRefreshLinkClick = () => { const { setSearchKeyword } = useSearchKeywordStore(); const { resetCompanyInfo } = useCompanyInfoStore(); const { setInitialSort: setPickInitialSort } = usePickDropdownStore(); + const { resetKeyword } = usePickSearchStore(); const { setInitialSort: setTechblogInitailSort } = useTechblogDropdownStore(); const invalidPickQuery = () => { queryClient.invalidateQueries({ queryKey: ['pickData'] }); setPickInitialSort(); + resetKeyword(); }; const refreshTechArticleParams = () => { diff --git a/pages/pickpickpick/index.page.tsx b/pages/pickpickpick/index.page.tsx index eaa547f9..9b21b5f6 100644 --- a/pages/pickpickpick/index.page.tsx +++ b/pages/pickpickpick/index.page.tsx @@ -1,4 +1,4 @@ -import React, { useRef, useState } from 'react'; +import React, { useRef } from 'react'; import dynamic from 'next/dynamic'; import Link from 'next/link'; @@ -20,6 +20,7 @@ import { META } from '@/constants/metaData'; import { ROUTES } from '@/constants/routes'; import { useMediaQueryContext } from '@/contexts/MediaQueryContext'; import { PickDropdownProps, usePickDropdownStore } from '@/stores/dropdownStore'; +import { usePickSearchStore } from '@/stores/pickSearchStore'; import { PickSearchInput } from './[id]/components/pickSearchInput'; import { PickActionSection } from './components/PickActionSection'; @@ -32,8 +33,13 @@ const DynamicComponent = dynamic(() => import('@/pages/pickpickpick/components/P export default function Index() { const bottom = useRef(null); - const [editingKeyword, setEditingKeyword] = useState(''); - const [submittedKeyword, setSubmittedKeyword] = useState(''); + const { + editingKeyword, + submittedKeyword, + setEditingKeyword, + setSubmittedKeyword, + resetKeyword, + } = usePickSearchStore(); const { MAIN } = ROUTES.PICKPICKPICK; const { isLoginModalOpen } = useLoginModalStore(); @@ -116,12 +122,7 @@ export default function Index() { return (
- { - setEditingKeyword(''); - setSubmittedKeyword(''); - }} - /> + {isMobile ? : } {getStatusComponent()}
diff --git a/stores/pickSearchStore.ts b/stores/pickSearchStore.ts new file mode 100644 index 00000000..fedc0ba0 --- /dev/null +++ b/stores/pickSearchStore.ts @@ -0,0 +1,17 @@ +import { create } from 'zustand'; + +interface PickSearchStoreProps { + editingKeyword: string; + submittedKeyword: string; + setEditingKeyword: (keyword: string) => void; + setSubmittedKeyword: (keyword: string) => void; + resetKeyword: () => void; +} + +export const usePickSearchStore = create((set) => ({ + editingKeyword: '', + submittedKeyword: '', + setEditingKeyword: (keyword: string) => set({ editingKeyword: keyword }), + setSubmittedKeyword: (keyword: string) => set({ submittedKeyword: keyword }), + resetKeyword: () => set({ editingKeyword: '', submittedKeyword: '' }), +})); From aa28f1187542e59a02d80605a06845bf616c9f89 Mon Sep 17 00:00:00 2001 From: mandelina Date: Wed, 19 Nov 2025 23:42:12 +0900 Subject: [PATCH 3/3] =?UTF-8?q?Fix=20:=20=EC=B2=98=EC=9D=8C=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=8F=8C=EC=95=84=EA=B0=80=EA=B8=B0=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=EC=9D=84=20=EB=88=8C=EB=A0=80=EC=9D=84=EB=95=8C?= =?UTF-8?q?=EB=8F=84=20keyword=EA=B0=80=20reset=EB=90=98=EB=8F=84=EB=A1=9D?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/pickpickpick/index.page.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pages/pickpickpick/index.page.tsx b/pages/pickpickpick/index.page.tsx index 9b21b5f6..dcae0464 100644 --- a/pages/pickpickpick/index.page.tsx +++ b/pages/pickpickpick/index.page.tsx @@ -33,13 +33,8 @@ const DynamicComponent = dynamic(() => import('@/pages/pickpickpick/components/P export default function Index() { const bottom = useRef(null); - const { - editingKeyword, - submittedKeyword, - setEditingKeyword, - setSubmittedKeyword, - resetKeyword, - } = usePickSearchStore(); + const { editingKeyword, submittedKeyword, setEditingKeyword, setSubmittedKeyword, resetKeyword } = + usePickSearchStore(); const { MAIN } = ROUTES.PICKPICKPICK; const { isLoginModalOpen } = useLoginModalStore(); @@ -66,7 +61,13 @@ export default function Index() { { + if (keyword === '') { + resetKeyword(); + } else { + setSubmittedKeyword(keyword); + } + }} /> )}