diff --git a/src/hooks/searchHook/useSearchItems.ts b/src/apps/stable/features/search/api/useSearchItems.ts similarity index 99% rename from src/hooks/searchHook/useSearchItems.ts rename to src/apps/stable/features/search/api/useSearchItems.ts index e720c8ac17..d073fac379 100644 --- a/src/hooks/searchHook/useSearchItems.ts +++ b/src/apps/stable/features/search/api/useSearchItems.ts @@ -14,7 +14,7 @@ import { getItemsApi } from '@jellyfin/sdk/lib/utils/api/items-api'; import { getPersonsApi } from '@jellyfin/sdk/lib/utils/api/persons-api'; import { getArtistsApi } from '@jellyfin/sdk/lib/utils/api/artists-api'; import { useQuery } from '@tanstack/react-query'; -import { useApi } from '../useApi'; +import { useApi } from '../../../../../hooks/useApi'; import type { CardOptions } from 'types/cardOptions'; import { CardShape } from 'utils/card'; diff --git a/src/hooks/searchHook/useSearchSuggestions.ts b/src/apps/stable/features/search/api/useSearchSuggestions.ts similarity index 97% rename from src/hooks/searchHook/useSearchSuggestions.ts rename to src/apps/stable/features/search/api/useSearchSuggestions.ts index a9b0ce4767..ea6e7b77e0 100644 --- a/src/hooks/searchHook/useSearchSuggestions.ts +++ b/src/apps/stable/features/search/api/useSearchSuggestions.ts @@ -4,7 +4,7 @@ import { ItemSortBy } from '@jellyfin/sdk/lib/generated-client'; import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client/models/base-item-kind'; import { getItemsApi } from '@jellyfin/sdk/lib/utils/api/items-api'; import { useQuery } from '@tanstack/react-query'; -import { useApi } from '../useApi'; +import { useApi } from 'hooks/useApi'; const fetchGetItems = async ( api?: Api, diff --git a/src/components/search/SearchFields.tsx b/src/apps/stable/features/search/components/SearchFields.tsx similarity index 88% rename from src/components/search/SearchFields.tsx rename to src/apps/stable/features/search/components/SearchFields.tsx index b1cea800c5..cd36dc2386 100644 --- a/src/components/search/SearchFields.tsx +++ b/src/apps/stable/features/search/components/SearchFields.tsx @@ -1,11 +1,11 @@ import React, { type ChangeEvent, type FC, useCallback, useRef } from 'react'; -import AlphaPicker from '../alphaPicker/AlphaPickerComponent'; +import AlphaPicker from '../../../../../components/alphaPicker/AlphaPickerComponent'; import Input from 'elements/emby-input/Input'; -import globalize from '../../lib/globalize'; -import layoutManager from '../layoutManager'; -import browser from '../../scripts/browser'; +import globalize from '../../../../../lib/globalize'; +import layoutManager from '../../../../../components/layoutManager'; +import browser from '../../../../../scripts/browser'; import 'material-design-icons-iconfont'; -import '../../styles/flexstyles.scss'; +import 'styles/flexstyles.scss'; import './searchfields.scss'; interface SearchFieldsProps { diff --git a/src/components/search/SearchResults.tsx b/src/apps/stable/features/search/components/SearchResults.tsx similarity index 89% rename from src/components/search/SearchResults.tsx rename to src/apps/stable/features/search/components/SearchResults.tsx index 3c7dec3376..24e6a83e4f 100644 --- a/src/components/search/SearchResults.tsx +++ b/src/apps/stable/features/search/components/SearchResults.tsx @@ -1,7 +1,7 @@ import React, { type FC } from 'react'; -import { Section, useSearchItems } from 'hooks/searchHook'; -import globalize from '../../lib/globalize'; -import Loading from '../loading/LoadingComponent'; +import { Section, useSearchItems } from '../api/useSearchItems'; +import globalize from '../../../../../lib/globalize'; +import Loading from '../../../../../components/loading/LoadingComponent'; import SearchResultsRow from './SearchResultsRow'; import { CardShape } from 'utils/card'; diff --git a/src/components/search/SearchResultsRow.tsx b/src/apps/stable/features/search/components/SearchResultsRow.tsx similarity index 89% rename from src/components/search/SearchResultsRow.tsx rename to src/apps/stable/features/search/components/SearchResultsRow.tsx index 4fad2a0966..be74c233c9 100644 --- a/src/components/search/SearchResultsRow.tsx +++ b/src/apps/stable/features/search/components/SearchResultsRow.tsx @@ -1,10 +1,10 @@ import type { BaseItemDto } from '@jellyfin/sdk/lib/generated-client'; import React, { type FC, useEffect, useRef } from 'react'; -import cardBuilder from '../cardbuilder/cardBuilder'; +import cardBuilder from 'components/cardbuilder/cardBuilder'; import type { CardOptions } from 'types/cardOptions'; -import '../../elements/emby-scroller/emby-scroller'; -import '../../elements/emby-itemscontainer/emby-itemscontainer'; +import 'elements/emby-scroller/emby-scroller'; +import 'elements/emby-itemscontainer/emby-itemscontainer'; // There seems to be some compatibility issues here between // React and our legacy web components, so we need to inject diff --git a/src/components/search/SearchSuggestions.tsx b/src/apps/stable/features/search/components/SearchSuggestions.tsx similarity index 83% rename from src/components/search/SearchSuggestions.tsx rename to src/apps/stable/features/search/components/SearchSuggestions.tsx index 809ad29444..d222443fdc 100644 --- a/src/components/search/SearchSuggestions.tsx +++ b/src/apps/stable/features/search/components/SearchSuggestions.tsx @@ -1,12 +1,12 @@ import React, { FunctionComponent } from 'react'; import Loading from 'components/loading/LoadingComponent'; -import { appRouter } from '../router/appRouter'; -import { useSearchSuggestions } from 'hooks/searchHook/useSearchSuggestions'; +import { appRouter } from '../../../../../components/router/appRouter'; +import { useSearchSuggestions } from '../api/useSearchSuggestions'; import globalize from 'lib/globalize'; -import LinkButton from '../../elements/emby-button/LinkButton'; +import LinkButton from '../../../../../elements/emby-button/LinkButton'; -import '../../elements/emby-button/emby-button'; +import '../../../../../elements/emby-button/emby-button'; type SearchSuggestionsProps = { parentId?: string | null; diff --git a/src/components/search/searchfields.scss b/src/apps/stable/features/search/components/searchfields.scss similarity index 100% rename from src/components/search/searchfields.scss rename to src/apps/stable/features/search/components/searchfields.scss diff --git a/src/apps/stable/routes/search.tsx b/src/apps/stable/routes/search.tsx index 290ea60406..4cf0b29b72 100644 --- a/src/apps/stable/routes/search.tsx +++ b/src/apps/stable/routes/search.tsx @@ -4,9 +4,9 @@ import { useDebounceValue } from 'usehooks-ts'; import { usePrevious } from 'hooks/usePrevious'; import globalize from 'lib/globalize'; import Page from 'components/Page'; -import SearchFields from 'components/search/SearchFields'; -import SearchSuggestions from 'components/search/SearchSuggestions'; -import SearchResults from 'components/search/SearchResults'; +import SearchFields from 'apps/stable/features/search/components/SearchFields'; +import SearchSuggestions from 'apps/stable/features/search/components/SearchSuggestions'; +import SearchResults from 'apps/stable/features/search/components/SearchResults'; const COLLECTION_TYPE_PARAM = 'collectionType'; const PARENT_ID_PARAM = 'parentId'; diff --git a/src/hooks/searchHook/index.ts b/src/hooks/searchHook/index.ts deleted file mode 100644 index 62ba9b422a..0000000000 --- a/src/hooks/searchHook/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './useSearchItems'; -export * from './useSearchSuggestions';