typescript-typenfehler behoben.. npm run lint läuft nun fehlerfrei durch.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useMemo, useState } from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { usePage } from "@inertiajs/react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import toast from "react-hot-toast";
|
||||
@@ -31,8 +31,6 @@ type SharedPageProps = {
|
||||
|
||||
type FieldErrors = Record<string, string>;
|
||||
|
||||
const fallbackRoute = (locale: string) => `/${locale}/login`;
|
||||
|
||||
const csrfToken = () => (document.querySelector('meta[name="csrf-token"]') as HTMLMetaElement | null)?.content ?? "";
|
||||
|
||||
export default function LoginForm({ onSuccess, canResetPassword = true, locale }: LoginFormProps) {
|
||||
|
||||
@@ -6,10 +6,8 @@ import { LoaderCircle, User, Mail, Phone, Lock, MapPin } from 'lucide-react';
|
||||
import { Dialog, DialogContent, DialogTitle, DialogDescription } from '@/components/ui/dialog';
|
||||
import type { GoogleProfilePrefill } from '../marketing/checkout/types';
|
||||
|
||||
declare const route: (name: string, params?: Record<string, unknown>) => string;
|
||||
|
||||
export interface RegisterSuccessPayload {
|
||||
user: any | null;
|
||||
user: unknown | null;
|
||||
redirect?: string | null;
|
||||
pending_purchase?: boolean;
|
||||
}
|
||||
@@ -69,7 +67,7 @@ export default function RegisterForm({ packageId, onSuccess, privacyHtml, locale
|
||||
const [serverError, setServerError] = useState<string | null>(null);
|
||||
const [serverErrorType, setServerErrorType] = useState<'generic' | 'session-expired'>('generic');
|
||||
const { t } = useTranslation(['auth', 'common']);
|
||||
const page = usePage<{ errors: Record<string, string>; locale?: string; auth?: { user?: any | null } }>();
|
||||
const page = usePage<{ errors: Record<string, string>; locale?: string; auth?: { user?: unknown | null } }>();
|
||||
const resolvedLocale = locale ?? page.props.locale ?? 'de';
|
||||
|
||||
const { data, setData, errors, clearErrors, reset, setError } = useForm<RegisterFormFields>({
|
||||
@@ -245,7 +243,7 @@ export default function RegisterForm({ packageId, onSuccess, privacyHtml, locale
|
||||
try {
|
||||
const json = await response.clone().json();
|
||||
message = json?.message ?? null;
|
||||
} catch (error) {
|
||||
} catch {
|
||||
message = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useForm } from '@inertiajs/react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { LoaderCircle, User, Mail, Phone, Lock, Home, MapPin } from 'lucide-react';
|
||||
import { LoaderCircle, User, Mail, Phone, Lock, MapPin } from 'lucide-react';
|
||||
import { Dialog, DialogContent, DialogTitle, DialogDescription } from '@/components/ui/dialog';
|
||||
|
||||
interface RegisterProps {
|
||||
|
||||
Reference in New Issue
Block a user