Refactoring the filters / search file structure

This commit is contained in:
Brandon Thomas committed 2023-01-18 21:58:07 -05:00
1 parent 0092135d9e
commit 49ab3a674f
9 files changed
+15 -15

No files matched your search

@@ -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";
@@ -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[];
@@ -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) {
}
/>
<MultiDropdownSearch
<OldMultiDropdownSearch
allTtsCategories={props.allTtsCategories}
allTtsModels={props.allTtsModels}
@@ -2,7 +2,7 @@ import React from "react";
import { faGlobe } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import Select from "react-select";
import { SearchFieldClass } from "../SearchFieldClass";
import { SearchFieldClass } from "../search/SearchFieldClass";
import { AVAILABLE_TTS_LANGUAGE_CATEGORY_MAP } from "../../../../../_i18n/AvailableLanguageMap";
interface Props {
@@ -7,9 +7,9 @@ import {
faTimes,
} from "@fortawesome/free-solid-svg-icons";
import { TtsModelListItem } from "@storyteller/components/src/api/tts/ListTtsModels";
import { TtsCategoryType } from "../../../../AppWrapper";
import { TtsCategoryType } from "../../../../../AppWrapper";
import { Trans, useTranslation } from "react-i18next";
import { Analytics } from "../../../../common/Analytics";
import { Analytics } from "../../../../../common/Analytics";
interface Props {
allTtsCategories: TtsCategoryType[];
@@ -29,7 +29,7 @@ interface Props {
setMaybeSelectedTtsModel: (maybeSelectedTtsModel: TtsModelListItem) => void;
}
export function MultiDropdownSearch(props: Props) {
export function OldMultiDropdownSearch(props: Props) {
const {
allTtsCategories,
allTtsModels,
@@ -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[];
@@ -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<string>("");
// NB: Hack to constrain number of matches.
@@ -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";