fix: eslint warnings (#252)
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
'use client';
|
||||
import { useState, useEffect, useContext } from 'react';
|
||||
import { Link, NextUiLinkClasses } from '@/src/i18n/routing';
|
||||
import { Button, Card, CardHeader, CardFooter } from '@heroui/react';
|
||||
import { TokenContext } from '@/utils/TokenProvider';
|
||||
import Avatar from 'boring-avatars';
|
||||
import { ArrowRight } from 'lucide-react';
|
||||
import { Link, NextUiLinkClasses } from '@/src/i18n/routing';
|
||||
import { TokenContext } from '@/utils/TokenProvider';
|
||||
import { fetchMyProjects } from '@/utils/projectsControl';
|
||||
import { ProjectType } from '@/types/project';
|
||||
import PublicityChip from '@/components/PublicityChip';
|
||||
import { LocaleCodeType } from '@/types/locale';
|
||||
import { ArrowRight } from 'lucide-react';
|
||||
import { logError } from '@/utils/errorHandler';
|
||||
|
||||
type AccountPageMessages = {
|
||||
yourProjects: string;
|
||||
@@ -36,8 +37,8 @@ export default function AccountPage({ messages, locale }: Props) {
|
||||
try {
|
||||
const data = await fetchMyProjects(context.token.access_token);
|
||||
setMyProjects(data);
|
||||
} catch (error: any) {
|
||||
console.error('Error in effect:', error.message);
|
||||
} catch (error: unknown) {
|
||||
logError('Error fetching data:', error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,13 +54,13 @@ export default function AccountPage({ messages, locale }: Props) {
|
||||
<CardHeader className="flex gap-6">
|
||||
<Avatar
|
||||
size={48}
|
||||
name={context.token!.user!.username}
|
||||
name={context.token?.user?.username}
|
||||
variant="beam"
|
||||
colors={['#0A0310', '#49007E', '#FF005B', '#FF7D10', '#FFB238']}
|
||||
/>
|
||||
<div className="flex flex-col">
|
||||
<p className="text-xl font-bold">{context.token!.user!.username}</p>
|
||||
<p className="text-lg text-default-500">{context.token!.user!.email}</p>
|
||||
<p className="text-xl font-bold">{context.token?.user?.username}</p>
|
||||
<p className="text-lg text-default-500">{context.token?.user?.email}</p>
|
||||
</div>
|
||||
</CardHeader>
|
||||
</Card>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { UserType } from '@/types/user';
|
||||
import Config from '@/config/config';
|
||||
import { roles } from '@/config/selection';
|
||||
import { logError } from '@/utils/errorHandler';
|
||||
const apiServer = Config.apiServer;
|
||||
|
||||
async function signUp(newUser: UserType) {
|
||||
@@ -21,8 +22,8 @@ async function signUp(newUser: UserType) {
|
||||
}
|
||||
const token = await response.json();
|
||||
return token;
|
||||
} catch (error: any) {
|
||||
console.error('Error sign up:', error);
|
||||
} catch (error: unknown) {
|
||||
logError('Error sign up:', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -45,8 +46,8 @@ async function signIn(signInUser: UserType) {
|
||||
}
|
||||
const token = await response.json();
|
||||
return token;
|
||||
} catch (error: any) {
|
||||
console.error('Error sign in:', error);
|
||||
} catch (error: unknown) {
|
||||
logError('Error sign in:', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
'use client';
|
||||
import React from 'react';
|
||||
import { useState, useContext } from 'react';
|
||||
import { Input, Button, Card, CardHeader, CardBody } from '@heroui/react';
|
||||
import { Link } from '@/src/i18n/routing';
|
||||
import { ChevronRight, Eye, EyeOff } from 'lucide-react';
|
||||
import { UserType, AuthMessages } from '@/types/user';
|
||||
import { roles } from '@/config/selection';
|
||||
import { signUp, signIn, signInAsGuest } from './authControl';
|
||||
import { isValidEmail, isValidPassword } from './validate';
|
||||
import { Link } from '@/src/i18n/routing';
|
||||
import { UserType, AuthMessages } from '@/types/user';
|
||||
import { roles } from '@/config/selection';
|
||||
import { TokenContext } from '@/utils/TokenProvider';
|
||||
import { useRouter } from '@/src/i18n/routing';
|
||||
import Config from '@/config/config';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { LocaleCodeType } from '@/types/locale';
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
import { LocaleCodeType } from '@/types/locale';
|
||||
|
||||
export async function generateMetadata({ params: { locale } }: { params: { locale: LocaleCodeType } }) {
|
||||
const t = await getTranslations({ locale, namespace: 'Auth' });
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { PageType } from '@/types/base';
|
||||
import AuthPage from '../authPage';
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import AuthPage from '../authPage';
|
||||
import { PageType } from '@/types/base';
|
||||
import { LocaleCodeType } from '@/types/locale';
|
||||
|
||||
export async function generateMetadata({ params: { locale } }: { params: { locale: LocaleCodeType } }) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { PageType } from '@/types/base';
|
||||
import AuthPage from '../authPage';
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import AuthPage from '../authPage';
|
||||
import { PageType } from '@/types/base';
|
||||
import { LocaleCodeType } from '@/types/locale';
|
||||
|
||||
export async function generateMetadata({ params: { locale } }: { params: { locale: LocaleCodeType } }) {
|
||||
|
||||
Reference in New Issue
Block a user