frontend: fix linted errors

This commit is contained in:
Kentai Radiquum 2024-04-23 18:52:41 +05:00
parent 9e75a0783c
commit 58ed4007df
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
9 changed files with 46 additions and 14 deletions

View file

@ -2,6 +2,7 @@
import { usePathname } from "next/navigation";
import Link from "next/link";
import Image from "next/image";
export const NavigationRail = (props) => {
const pathname = usePathname();
@ -37,7 +38,7 @@ export const NavigationRail = (props) => {
return (
<nav className="left">
<button className="circle transparent ">
<img className="responsive" src="/favicon.ico"></img>
<Image className="responsive" src="/favicon.ico" alt="Ваш профиль" />
</button>
{items.map((item) => {

View file

@ -1,6 +1,7 @@
"use client";
import Link from "next/link";
import Image from "next/image";
export const ReleaseCard = (props) => {
return (
@ -9,7 +10,11 @@ export const ReleaseCard = (props) => {
className="no-padding round fill"
style={{ width: 284, height: 508 }}
>
<img className="responsive large top-round" src={props.poster} />
<Image
className="responsive large top-round"
src={props.poster}
alt=""
/>
<div className="padding">
<h6>{`${props.title.substring(0, 36)}${
[...props.title].length > 36 ? "..." : ""

View file

@ -3,8 +3,8 @@
import { LogInNeeded } from "@/app/components/LogInNeeded/LogInNeeded";
import { useUserStore } from "@/app/store/user-store";
export default History = () => {
export default function History() {
const userStore = useUserStore();
return <>{!userStore.isAuth ? <LogInNeeded /> : ""}</>;
};
}

View file

@ -1,3 +1,3 @@
export default () => {
export default function LoginPage() {
return <p>login page</p>;
};
}

View file

@ -34,6 +34,7 @@ export default function Home() {
} else {
setList("last");
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
async function fetchData(list, page = 0) {
@ -55,12 +56,14 @@ export default function Home() {
setPage(0);
fetchData(list); // Call fetchData here
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [list]);
useEffect(() => {
if (list && releases) {
fetchData(list, page); // Use fetchData for pagination
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [page]);
const chips = [

View file

@ -53,12 +53,14 @@ export default function Search() {
setQuery(query);
fetchData(query, 0);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
useEffect(() => {
if (releases) {
fetchData(query, page); // Use fetchData for pagination
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [page]);
const handleInput = (e) => {