fixed eslint warnings + made search filter explicit
continuous-integration/drone/push Build is passing Details

nextui
Guus van Meerveld 8 months ago
parent 306585ad98
commit 1ffb926631

@ -20,7 +20,7 @@ const Menu: Component = () => {
return () => { return () => {
window.removeEventListener("click", handleClick); window.removeEventListener("click", handleClick);
}; };
}, [hide, shouldShow]); }, [handleClick]);
return ( return (
<div <div

@ -27,15 +27,21 @@ export const Filter: Component<{
[] []
); );
const currentMenuItem = filterMenuItems.find((item) => item.key === filter);
return ( return (
<Dropdown> <Dropdown>
<DropdownTrigger> <DropdownTrigger>
<Button className="h-full" variant="bordered" isIconOnly> <Button
<FilterIcon className="text-xl" /> startContent={<FilterIcon className="text-xl" />}
className="h-full"
variant="bordered"
>
{currentMenuItem?.label}
</Button> </Button>
</DropdownTrigger> </DropdownTrigger>
<DropdownMenu <DropdownMenu
aria-label="Static Actions" aria-label="Filter search results"
items={filterMenuItems} items={filterMenuItems}
selectionMode="single" selectionMode="single"
selectedKeys={[filter]} selectedKeys={[filter]}

@ -52,9 +52,9 @@ export const Playlist: Component<{ data: PlaylistProps }> = ({ data }) => {
{data.videos && ( {data.videos && (
<div className="flex flex-col gap-1"> <div className="flex flex-col gap-1">
{data.videos.map((video) => { {data.videos.map((video) => (
return <h1>{video.title}</h1>; <h1 key={video.id}>{video.title}</h1>
})} ))}
</div> </div>
)} )}
</div> </div>

@ -68,14 +68,14 @@ export const Search: Component = () => {
(filter: SearchType) => { (filter: SearchType) => {
searchFor(query, filter); searchFor(query, filter);
}, },
[query] [query, searchFor]
); );
const handleUserReachedPageEnd = useCallback( const handleUserReachedPageEnd = useCallback(
(visiblity: boolean) => { (visiblity: boolean) => {
if (visiblity && !isFetchingNextPage) fetchNextPage(); if (visiblity && !isFetchingNextPage) fetchNextPage();
}, },
[hasNextPage, isFetchingNextPage] [hasNextPage, isFetchingNextPage, fetchNextPage]
); );
return ( return (

@ -59,7 +59,7 @@ export const Trending: Component = ({}) => {
); );
return null; return null;
}, [data]); }, [data, region]);
const error: Error | null = regionError ?? fetchError ?? noDataError ?? null; const error: Error | null = regionError ?? fetchError ?? noDataError ?? null;

@ -30,9 +30,9 @@ export const Search: Component<{
} }
}); });
const submit = useCallback((query: string) => { const submit = (query: string) => {
searchFor(query); searchFor(query);
}, []); };
const suggestions = useMemo( const suggestions = useMemo(
() => () =>

Loading…
Cancel
Save