From 004eb3e315de5a344b8350606a750a3cb0b8cc59 Mon Sep 17 00:00:00 2001 From: swawa-yu Date: Tue, 2 Apr 2024 00:44:15 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=E6=A4=9C=E7=B4=A2=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E3=81=AE=E5=A4=89=E6=9B=B4=E3=81=AB=E5=BF=9C=E3=81=98=E3=81=A6?= =?UTF-8?q?=E5=8D=B3=E6=A4=9C=E7=B4=A2=E7=B5=90=E6=9E=9C=E3=82=92=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 5 ++--- src/components/SearchComponent/SearchComponent.tsx | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 71ffb23..af8a996 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -16,10 +16,9 @@ function App() { initializeSubject(); const [searchOptions, setSearchOptions] = useState(initialSearchOptions); - const [actualSearchOptions, setActualSearchOptions] = useState(initialSearchOptions); const handleSearch = (newSearchOptions: SearchOptions) => { - setActualSearchOptions(newSearchOptions); + setSearchOptions(newSearchOptions); }; // テーマのステートを追加 (デフォルトはシステムの設定に依存) @@ -69,7 +68,7 @@ function App() { - + diff --git a/src/components/SearchComponent/SearchComponent.tsx b/src/components/SearchComponent/SearchComponent.tsx index 6ee1925..3bc4acf 100644 --- a/src/components/SearchComponent/SearchComponent.tsx +++ b/src/components/SearchComponent/SearchComponent.tsx @@ -238,7 +238,6 @@ const SearchComponent: React.FC = ({ searchOptions, onSear
-
From 70f23796206a4711699886fdc118e7240c48efd9 Mon Sep 17 00:00:00 2001 From: swawa-yu Date: Tue, 2 Apr 2024 11:37:21 +0900 Subject: [PATCH 2/3] =?UTF-8?q?handleSearch=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SearchComponent/SearchComponent.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/components/SearchComponent/SearchComponent.tsx b/src/components/SearchComponent/SearchComponent.tsx index 3bc4acf..a32d1b7 100644 --- a/src/components/SearchComponent/SearchComponent.tsx +++ b/src/components/SearchComponent/SearchComponent.tsx @@ -13,10 +13,6 @@ type SearchComponentProps = { // TODO: あいまい検索に対応(generalSearch) const SearchComponent: React.FC = ({ searchOptions, onSearch, setSearchOptions }: SearchComponentProps) => { - const handleSearch = () => { - onSearch(searchOptions); - }; - const handleClear = () => { setSearchOptions(initialSearchOptions); }; From 3dcb06112ecdf43a80cf21ad6bcc42438ae3f0b0 Mon Sep 17 00:00:00 2001 From: swawa-yu Date: Tue, 2 Apr 2024 11:58:14 +0900 Subject: [PATCH 3/3] =?UTF-8?q?onSearch=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 6 +----- src/components/SearchComponent/SearchComponent.tsx | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index af8a996..72a9d43 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -17,10 +17,6 @@ function App() { const [searchOptions, setSearchOptions] = useState(initialSearchOptions); - const handleSearch = (newSearchOptions: SearchOptions) => { - setSearchOptions(newSearchOptions); - }; - // テーマのステートを追加 (デフォルトはシステムの設定に依存) const [theme, setTheme] = useState(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'); @@ -66,7 +62,7 @@ function App() { - + diff --git a/src/components/SearchComponent/SearchComponent.tsx b/src/components/SearchComponent/SearchComponent.tsx index a32d1b7..4c19055 100644 --- a/src/components/SearchComponent/SearchComponent.tsx +++ b/src/components/SearchComponent/SearchComponent.tsx @@ -8,11 +8,10 @@ import { kaikouBukyokus, kaikouBukyokuGakubus, kaikouBukyokuDaigakuins } from '. type SearchComponentProps = { setSearchOptions: React.Dispatch>; searchOptions: SearchOptions; - onSearch: (newSearchOptions: SearchOptions) => void; }; // TODO: あいまい検索に対応(generalSearch) -const SearchComponent: React.FC = ({ searchOptions, onSearch, setSearchOptions }: SearchComponentProps) => { +const SearchComponent: React.FC = ({ searchOptions, setSearchOptions }: SearchComponentProps) => { const handleClear = () => { setSearchOptions(initialSearchOptions); };