X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fsearch.tsx;h=99b180356b87c5ab89f789a795c49c81f9ef8645;hb=53c3cfeade90150b07431386745a24aa699a25ec;hp=d32e408755de63e2f6b23f98c18a677e4d927b4a;hpb=6126900bd54a302c871cc52f332a725fe159d04b;p=lemmy-ui.git
diff --git a/src/shared/components/search.tsx b/src/shared/components/search.tsx
index d32e408..99b1803 100644
--- a/src/shared/components/search.tsx
+++ b/src/shared/components/search.tsx
@@ -1,3 +1,28 @@
+import {
+ commentsToFlatNodes,
+ communityToChoice,
+ enableDownvotes,
+ enableNsfw,
+ fetchCommunities,
+ fetchUsers,
+ getUpdatedSearchId,
+ myAuth,
+ personToChoice,
+ setIsoData,
+ showLocal,
+} from "@utils/app";
+import { restoreScrollPosition, saveScrollPosition } from "@utils/browser";
+import {
+ capitalizeFirstLetter,
+ debounce,
+ getIdFromString,
+ getPageFromString,
+ getQueryParams,
+ getQueryString,
+ numToSI,
+} from "@utils/helpers";
+import type { QueryParams } from "@utils/types";
+import { Choice, RouteDataResponse } from "@utils/types";
import type { NoOptionI18nKeys } from "i18next";
import { Component, linkEvent } from "inferno";
import {
@@ -20,35 +45,10 @@ import {
SearchType,
SortType,
} from "lemmy-js-client";
-import { i18n } from "../i18next";
+import { fetchLimit } from "../config";
import { CommentViewType, InitialFetchRequest } from "../interfaces";
-import { FirstLoadService } from "../services/FirstLoadService";
+import { FirstLoadService, I18NextService } from "../services";
import { HttpService, RequestState } from "../services/HttpService";
-import {
- Choice,
- capitalizeFirstLetter,
- commentsToFlatNodes,
- communityToChoice,
- enableDownvotes,
- enableNsfw,
- fetchCommunities,
- fetchLimit,
- fetchUsers,
- getIdFromString,
- getPageFromString,
- getUpdatedSearchId,
- myAuth,
- numToSI,
- personToChoice,
- restoreScrollPosition,
- saveScrollPosition,
- setIsoData,
- showLocal,
-} from "../utils";
-import { debounce } from "../utils/helpers/debounce";
-import { getQueryParams } from "../utils/helpers/get-query-params";
-import { getQueryString } from "../utils/helpers/get-query-string";
-import type { QueryParams } from "../utils/types/query-params";
import { CommentNodes } from "./comment/comment-nodes";
import { HtmlTags } from "./common/html-tags";
import { Spinner } from "./common/icon";
@@ -70,6 +70,14 @@ interface SearchProps {
page: number;
}
+type SearchData = RouteDataResponse<{
+ communityResponse: GetCommunityResponse;
+ listCommunitiesResponse: ListCommunitiesResponse;
+ creatorDetailsResponse: GetPersonDetailsResponse;
+ searchResponse: SearchResponse;
+ resolveObjectResponse: ResolveObjectResponse;
+}>;
+
type FilterType = "creator" | "community";
interface SearchState {
@@ -173,15 +181,15 @@ const Filter = ({
loading: boolean;
}) => {
return (
-
-