From 49ab3a674f4e833951f0eee3527a9af2bae0bd0d Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Wed, 18 Jan 2023 21:58:07 -0500 Subject: [PATCH] Refactoring the filters / search file structure --- .../src/v2/view/tts/tts_model_list/TtsModelListPage.tsx | 6 +++--- .../v2/view/tts/tts_model_list/explore/CategoryOptions.tsx | 2 +- .../view/tts/tts_model_list/explore/ExploreVoicesModal.tsx | 4 ++-- .../v2/view/tts/tts_model_list/explore/LanguageOptions.tsx | 2 +- .../OldMultiDropdownSearch.tsx} | 6 +++--- .../tts/tts_model_list/explore/ScopedVoiceModelOptions.tsx | 2 +- .../OldAutocompleteSearch.tsx} | 6 +++--- .../tts/tts_model_list/{ => search}/SearchFieldClass.ts | 0 .../view/tts/tts_model_list/{ => search}/SelectSearch.tsx | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) rename packages/fakeyou.com/src/v2/view/tts/tts_model_list/{MultiDropdownSearch.tsx => explore/OldMultiDropdownSearch.tsx} (98%) rename packages/fakeyou.com/src/v2/view/tts/tts_model_list/{AutocompleteSearch.tsx => search/OldAutocompleteSearch.tsx} (95%) rename packages/fakeyou.com/src/v2/view/tts/tts_model_list/{ => search}/SearchFieldClass.ts (100%) rename packages/fakeyou.com/src/v2/view/tts/tts_model_list/{ => search}/SelectSearch.tsx (97%) diff --git a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx index 90ecc8b3e6..a3271b6631 100644 --- a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx +++ b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx @@ -27,9 +27,9 @@ import { ListTtsCategoriesIsError, ListTtsCategoriesIsOk, } from "../../../api/category/ListTtsCategories"; -import { MultiDropdownSearch } from "./MultiDropdownSearch"; +import { OldMultiDropdownSearch } from "./explore/OldMultiDropdownSearch"; import { TtsCategoryType } from "../../../../AppWrapper"; -import { SelectSearch } from "./SelectSearch"; +import { SelectSearch } from "./search/SelectSearch"; import { LanguageNotice } from "./notices/LanguageNotice"; import { Language } from "@storyteller/components/src/i18n/Language"; import { t } from "i18next"; @@ -71,7 +71,7 @@ import { } from "../../../../model/categories/SyntheticCategory"; import Select from "react-select"; import AsyncSelect from "react-select/async"; -import { SearchFieldClass } from "./SearchFieldClass"; +import { SearchFieldClass } from "./search/SearchFieldClass"; import { AvailableTtsLanguageKey, AVAILABLE_LANGUAGE_MAP, ENGLISH_LANGUAGE } from "../../../../_i18n/AvailableLanguageMap"; import { ExploreVoicesModal } from "./explore/ExploreVoicesModal"; import { FrontendUrlConfig } from "../../../../common/FrontendUrlConfig"; diff --git a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/CategoryOptions.tsx b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/CategoryOptions.tsx index 56d8b75cbc..e4c2422941 100644 --- a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/CategoryOptions.tsx +++ b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/CategoryOptions.tsx @@ -12,7 +12,7 @@ import { TtsCategoryType } from "../../../../../AppWrapper"; import { Trans, useTranslation } from "react-i18next"; import { Analytics } from "../../../../../common/Analytics"; import Select from "react-select"; -import { SearchFieldClass } from "../SearchFieldClass"; +import { SearchFieldClass } from "../search/SearchFieldClass"; interface Props { allTtsCategories: TtsCategoryType[]; diff --git a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/ExploreVoicesModal.tsx b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/ExploreVoicesModal.tsx index 6a41f4f2a7..11f0ef194f 100644 --- a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/ExploreVoicesModal.tsx +++ b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/ExploreVoicesModal.tsx @@ -4,7 +4,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { LanguageOptions } from "./LanguageOptions"; import { TtsCategoryType } from "../../../../../AppWrapper"; import { TtsModelListItem } from "@storyteller/components/src/api/tts/ListTtsModels"; -import { MultiDropdownSearch } from "../MultiDropdownSearch"; +import { OldMultiDropdownSearch } from "./OldMultiDropdownSearch"; import { CategoryOptions } from "./CategoryOptions"; import { ScopedVoiceModelOptions } from "./ScopedVoiceModelOptions"; @@ -112,7 +112,7 @@ export function ExploreVoicesModal(props: Props) { } /> - void; } -export function MultiDropdownSearch(props: Props) { +export function OldMultiDropdownSearch(props: Props) { const { allTtsCategories, allTtsModels, diff --git a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/ScopedVoiceModelOptions.tsx b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/ScopedVoiceModelOptions.tsx index 9ee60997f5..4406efee3d 100644 --- a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/ScopedVoiceModelOptions.tsx +++ b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/ScopedVoiceModelOptions.tsx @@ -12,7 +12,7 @@ import { TtsCategoryType } from "../../../../../AppWrapper"; import { Trans, useTranslation } from "react-i18next"; import { Analytics } from "../../../../../common/Analytics"; import Select from "react-select"; -import { SearchFieldClass } from "../SearchFieldClass"; +import { SearchFieldClass } from "../search/SearchFieldClass"; interface Props { allTtsCategories: TtsCategoryType[]; diff --git a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/AutocompleteSearch.tsx b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/search/OldAutocompleteSearch.tsx similarity index 95% rename from packages/fakeyou.com/src/v2/view/tts/tts_model_list/AutocompleteSearch.tsx rename to packages/fakeyou.com/src/v2/view/tts/tts_model_list/search/OldAutocompleteSearch.tsx index 4aab1dd2ea..483ae90c3e 100644 --- a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/AutocompleteSearch.tsx +++ b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/search/OldAutocompleteSearch.tsx @@ -1,11 +1,11 @@ import React, { useState } from "react"; import { TtsModelListItem } from "@storyteller/components/src/api/tts/ListTtsModels"; -import { TtsCategoryType } from "../../../../AppWrapper"; +import { TtsCategoryType } from "../../../../../AppWrapper"; import Autocomplete from "react-autocomplete"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faSearch } from "@fortawesome/free-solid-svg-icons"; import { t } from "i18next"; -import { Analytics } from "../../../../common/Analytics"; +import { Analytics } from "../../../../../common/Analytics"; // NB: This probably is not the best autocomplete library in the world // A lot of the libraries are really old and depend on jQuery (gross). @@ -27,7 +27,7 @@ interface Props { setMaybeSelectedTtsModel: (maybeSelectedTtsModel: TtsModelListItem) => void; } -export function AutocompleteSearch(props: Props) { +export function OldAutocompleteSearch(props: Props) { const [searchValue, setSearchValue] = useState(""); // NB: Hack to constrain number of matches. diff --git a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/SearchFieldClass.ts b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/search/SearchFieldClass.ts similarity index 100% rename from packages/fakeyou.com/src/v2/view/tts/tts_model_list/SearchFieldClass.ts rename to packages/fakeyou.com/src/v2/view/tts/tts_model_list/search/SearchFieldClass.ts diff --git a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/SelectSearch.tsx b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/search/SelectSearch.tsx similarity index 97% rename from packages/fakeyou.com/src/v2/view/tts/tts_model_list/SelectSearch.tsx rename to packages/fakeyou.com/src/v2/view/tts/tts_model_list/search/SelectSearch.tsx index 2e3de93020..5244088ddc 100644 --- a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/SelectSearch.tsx +++ b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/search/SelectSearch.tsx @@ -1,6 +1,6 @@ import React from "react"; import { TtsModelListItem } from "@storyteller/components/src/api/tts/ListTtsModels"; -import { TtsCategoryType } from "../../../../AppWrapper"; +import { TtsCategoryType } from "../../../../../AppWrapper"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faMicrophone } from "@fortawesome/free-solid-svg-icons"; import Select, { ActionMeta } from "react-select";