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 () => {
window.removeEventListener("click", handleClick);
};
}, [hide, shouldShow]);
}, [handleClick]);
return (
<div

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

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

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

@ -59,7 +59,7 @@ export const Trending: Component = ({}) => {
);
return null;
}, [data]);
}, [data, region]);
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);
}, []);
};
const suggestions = useMemo(
() =>

Loading…
Cancel
Save