Skip to content

Commit

Permalink
it's buggy but it's a search page
Browse files Browse the repository at this point in the history
  • Loading branch information
sphinxrave committed Oct 29, 2024
1 parent c1969a9 commit c4647a5
Show file tree
Hide file tree
Showing 8 changed files with 2,137 additions and 10 deletions.
7 changes: 7 additions & 0 deletions packages/react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@tanstack/query-persist-client-core": "^5.59.13",
"@tanstack/react-query": "^5.59.15",
"@tanstack/react-query-devtools": "^5.59.15",
"@types/elasticsearch": "^5.0.43",
"@types/react-text-mask": "^5.4.14",
"@types/wicg-file-system-access": "^2023.10.5",
"class-variance-authority": "^0.7.0",
Expand Down Expand Up @@ -140,4 +141,4 @@
"unocss-preset-autoprefixer": "^0.0.7",
"vite": "^5.3.4"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
useSearchboxAutocomplete,
} from "../hooks/useAutocomplete";
import { useAtom } from "jotai";
import { JSON_SCHEMA, QueryItem } from "../types";
import { JSON_SCHEMA, QueryItem, VideoQueryContainer } from "../types";
import { QueryBadge } from "./QueryBadge";
import { useTranslation } from "react-i18next";
import { HTMLAttributes, useRef, useState, useCallback } from "react";
Expand Down Expand Up @@ -83,9 +83,15 @@ export function SearchBar({
const doSearch = useCallback(() => {
if (query.length > 0) {
const qm = getQueryModelFromQuery(query);
if (!qm) return;
navigate({
pathname: "/search",
search: "?" + stringify(qm),
search:
"?" +
stringify({
q: qm,
pagination: { size: 24, sort: "latest" },
} satisfies VideoQueryContainer),
});
}
}, [navigate, query]);
Expand Down
Loading

0 comments on commit c4647a5

Please sign in to comment.