mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-06 20:15:17 +02:00
Merge pull request #111 from MODSetter/dev
fix: Added Suspense boundary in Login Page
This commit is contained in:
commit
be8cbbe7b6
1 changed files with 24 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect, Suspense } from "react";
|
||||||
import { GoogleLoginButton } from "./GoogleLoginButton";
|
import { GoogleLoginButton } from "./GoogleLoginButton";
|
||||||
import { LocalLoginForm } from "./LocalLoginForm";
|
import { LocalLoginForm } from "./LocalLoginForm";
|
||||||
import { Logo } from "@/components/Logo";
|
import { Logo } from "@/components/Logo";
|
||||||
|
|
@ -8,7 +8,7 @@ import { AmbientBackground } from "./AmbientBackground";
|
||||||
import { useSearchParams } from "next/navigation";
|
import { useSearchParams } from "next/navigation";
|
||||||
import { Loader2 } from "lucide-react";
|
import { Loader2 } from "lucide-react";
|
||||||
|
|
||||||
export default function LoginPage() {
|
function LoginContent() {
|
||||||
const [authType, setAuthType] = useState<string | null>(null);
|
const [authType, setAuthType] = useState<string | null>(null);
|
||||||
const [registrationSuccess, setRegistrationSuccess] = useState(false);
|
const [registrationSuccess, setRegistrationSuccess] = useState(false);
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
|
|
@ -65,3 +65,25 @@ export default function LoginPage() {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Loading fallback for Suspense
|
||||||
|
const LoadingFallback = () => (
|
||||||
|
<div className="relative w-full overflow-hidden">
|
||||||
|
<AmbientBackground />
|
||||||
|
<div className="mx-auto flex h-screen max-w-lg flex-col items-center justify-center">
|
||||||
|
<Logo className="rounded-md" />
|
||||||
|
<div className="mt-8 flex items-center space-x-2">
|
||||||
|
<Loader2 className="h-5 w-5 animate-spin text-muted-foreground" />
|
||||||
|
<span className="text-muted-foreground">Loading...</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
export default function LoginPage() {
|
||||||
|
return (
|
||||||
|
<Suspense fallback={<LoadingFallback />}>
|
||||||
|
<LoginContent />
|
||||||
|
</Suspense>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue