chore: fix build

This commit is contained in:
Kentai Radiquum 2024-11-17 02:43:05 +05:00
parent 58f5c9ce7c
commit 7a95a3e126
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
7 changed files with 15 additions and 4 deletions

View file

@ -44,6 +44,7 @@ export const ProfileEditLoginModal = (props: {
_setLoginLength(data.login.length);
setLoading(false);
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [props.isOpen]);
function handleInput(e: any) {

View file

@ -69,15 +69,15 @@ export const ProfileEditModal = (props: {
9: "Неизвестно",
};
function _fetchInfo(url: string) {
function useFetchInfo(url: string) {
const { data, isLoading, error } = useSWR(url, fetcher);
return [data, isLoading, error];
}
const [prefData, prefLoading, prefError] = _fetchInfo(
const [prefData, prefLoading, prefError] = useFetchInfo(
`${ENDPOINTS.user.settings.my}?token=${props.token}`
);
const [loginData, loginLoading, loginError] = _fetchInfo(
const [loginData, loginLoading, loginError] = useFetchInfo(
`${ENDPOINTS.user.settings.login.info}?token=${props.token}`
);
@ -141,6 +141,7 @@ export const ProfileEditModal = (props: {
}
});
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [avatarUri]);
return (

View file

@ -69,8 +69,10 @@ export const ProfileEditSocialModal = (props: {
});
setLoading(false);
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [props.isOpen]);
function handleInput(e: any) {
const social = {
...socials,

View file

@ -21,6 +21,7 @@ export const ProfileEditStatusModal = (props: {
useEffect(() => {
_setStatus(props.status);
_setStringLength(props.status.length);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [props.isOpen]);
function handleInput(e: any) {

View file

@ -65,6 +65,7 @@ export const ProfileStats = (props: {
);
chart.render();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (

View file

@ -91,6 +91,7 @@ export const ProfileWatchDynamic = (props: { watchDynamic: Array<any> }) => {
);
chart.render();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (

View file

@ -5,6 +5,7 @@ import Link from "next/link";
import { useRouter } from "next/navigation";
import { SettingsModal } from "#/components/SettingsModal/SettingsModal";
import { useEffect, useState } from "react";
import Image from "next/image";
export const MenuPage = () => {
const userStore = useUserStore();
@ -15,6 +16,7 @@ export const MenuPage = () => {
if (!userStore.user) {
router.push("/");
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [userStore.user]);
return (
@ -28,8 +30,10 @@ export const MenuPage = () => {
>
<Card className="flex-1 w-full min-w-full sm:w-auto sm:min-w-0">
<div className="flex items-center gap-4">
<img
<Image
src={userStore.user.avatar}
width={64}
height={64}
alt=""
className="w-16 h-16 rounded-full sm:w-28 sm:h-28"
/>