mirror of
https://github.com/trushildhokiya/allininx-2.git
synced 2025-03-15 10:08:39 +00:00
bug fixes
This commit is contained in:
parent
6f692a54a8
commit
5a6c465dab
@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
@ -7,12 +7,19 @@ import { usePrivy } from "@privy-io/react-auth";
|
|||||||
const signin: React.FC = () => {
|
const signin: React.FC = () => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { login, authenticated, ready } = usePrivy();
|
const { login, authenticated, ready } = usePrivy();
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (ready && authenticated) {
|
if (ready && authenticated) {
|
||||||
|
setIsLoading(true);
|
||||||
|
// Add a small delay to ensure smooth transition
|
||||||
|
const redirectTimer = setTimeout(() => {
|
||||||
router.push("/chat");
|
router.push("/chat");
|
||||||
|
}, 2000);
|
||||||
|
|
||||||
|
return () => clearTimeout(redirectTimer);
|
||||||
}
|
}
|
||||||
}, [authenticated, ready, router]);
|
}, [authenticated, router]);
|
||||||
|
|
||||||
const handleAccess = () => {
|
const handleAccess = () => {
|
||||||
login();
|
login();
|
||||||
@ -30,12 +37,22 @@ const signin: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
<h1 className="text-xl font-bold text-white">Welcome to Allinix</h1>
|
<h1 className="text-xl font-bold text-white">Welcome to Allinix</h1>
|
||||||
<p className="mb-8 text-gray-400">Get access to dashboard</p>
|
<p className="mb-8 text-gray-400">Get access to dashboard</p>
|
||||||
|
{isLoading ? (
|
||||||
|
<div className="w-full space-y-3">
|
||||||
|
<div className="h-1 w-full overflow-hidden rounded-full bg-gray-700">
|
||||||
|
<div className="h-full w-1/2 animate-[loading_1s_ease-in-out_infinite] bg-blue-500"></div>
|
||||||
|
</div>
|
||||||
|
<p className="text-sm text-gray-400">Redirecting to dashboard...</p>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
<button
|
<button
|
||||||
onClick={handleAccess}
|
onClick={handleAccess}
|
||||||
className="btn-primary w-full rounded-md px-4 py-2 font-semibold text-white"
|
className="btn-primary w-full rounded-md px-4 py-2 font-semibold text-white"
|
||||||
|
disabled={isLoading}
|
||||||
>
|
>
|
||||||
SIGN IN
|
SIGN IN
|
||||||
</button>
|
</button>
|
||||||
|
)}
|
||||||
<div className="mt-8 flex justify-center gap-8">
|
<div className="mt-8 flex justify-center gap-8">
|
||||||
<Link
|
<Link
|
||||||
href={"https://x.com/allinix_ai"}
|
href={"https://x.com/allinix_ai"}
|
||||||
|
@ -15,6 +15,15 @@ img {
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes loading {
|
||||||
|
0% {
|
||||||
|
transform: translateX(-100%);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: translateX(200%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.gradient-text {
|
.gradient-text {
|
||||||
background: linear-gradient(180deg, #fff 0%, #525252 100%);
|
background: linear-gradient(180deg, #fff 0%, #525252 100%);
|
||||||
background-clip: text;
|
background-clip: text;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user