feat: some shit

This commit is contained in:
2023-08-08 11:03:20 +02:00
parent eb1d065f1f
commit dccb6a6ecf
9 changed files with 95 additions and 19 deletions

View File

@@ -14,14 +14,13 @@ import { isLocalImage } from "@lib/string.ts";
export const RedirectSearchHandler = () => {
useEventListener("keydown", (e: KeyboardEvent) => {
if (e?.target?.nodeName == "INPUT") return;
if (
e.key === "?" &&
window.location.search === ""
) {
window.location.href += "?q=";
}
});
}, document?.body);
return <></>;
};
@@ -136,13 +135,14 @@ const SearchComponent = (
debouncedFetchData(q);
}, []);
console.log({ data, isLoading });
return (
<div class="mt-2">
<div
class="flex items-center gap-1 rounded-xl w-full shadow-2xl"
style={{ background: "#2B2930", color: "#818181" }}
>
{isLoading
{isLoading && searchQuery
? <IconLoader2 class="w-4 h-4 ml-4 mr-2 animate-spin" />
: <IconSearch class="w-4 h-4 ml-4 mr-2" />}
<input