feat: some shit
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user