Update src/app/login/page.tsx

This commit is contained in:
2026-03-09 09:49:40 +00:00
parent 1c92365ad2
commit ca3caaf4a8

View File

@@ -1,58 +1,16 @@
'use client';
import { ThemeProvider } from '@/components/theme/ThemeProvider';
import { NavbarStyleFullscreen } from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import { useState } from 'react';
import { ThemeProvider } from '@/providers/themeProvider/ThemeProvider';
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
const navItems = [
{ name: 'Home', id: '/' },
{ name: 'Features', id: '/#features' },
{ name: 'Dashboard', id: '/dashboard' },
{ name: 'Sign In', id: '/login' },
];
const footerColumns = [
{
title: 'Product',
items: [
{ label: 'Features', href: '/#features' },
{ label: 'Dashboard', href: '/dashboard' },
{ label: 'Pricing', href: '/#pricing' },
],
},
{
title: 'Legal',
items: [
{ label: 'Privacy', href: '/privacy' },
{ label: 'Terms', href: '/terms' },
],
},
{ name: 'Register', id: '/register' },
];
export default function LoginPage() {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [error, setError] = useState('');
const [isLoading, setIsLoading] = useState(false);
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setError('');
if (!email || !password) {
setError('Email and password are required');
return;
}
setIsLoading(true);
// Simulate login delay
await new Promise((resolve) => setTimeout(resolve, 1500));
// Simulate successful login
console.log('Login attempt:', { email, password });
window.location.href = '/dashboard';
};
return (
<ThemeProvider
defaultButtonVariant="hover-magnetic"
@@ -66,79 +24,30 @@ export default function LoginPage() {
secondaryButtonStyle="glass"
headingFontWeight="bold"
>
<NavbarStyleFullscreen
navItems={navItems}
brandName="AccountHub"
bottomLeftText="Global Community"
bottomRightText="support@accounthub.com"
/>
<div className="min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 bg-gradient-to-br from-background to-card">
<div className="w-full max-w-md bg-card rounded-lg shadow-lg p-8">
<h1 className="text-3xl font-bold text-foreground mb-2 text-center">
Sign In
</h1>
<p className="text-foreground/60 text-center mb-8">
Access your AccountHub dashboard
</p>
<form onSubmit={handleSubmit} className="space-y-4">
<div>
<label className="block text-sm font-medium text-foreground mb-2">
Email
</label>
<input
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
className="w-full px-4 py-2 border border-foreground/20 rounded-lg bg-background text-foreground placeholder-foreground/40 focus:outline-none focus:ring-2 focus:ring-primary-cta"
placeholder="your@email.com"
/>
</div>
<div>
<label className="block text-sm font-medium text-foreground mb-2">
Password
</label>
<input
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
className="w-full px-4 py-2 border border-foreground/20 rounded-lg bg-background text-foreground placeholder-foreground/40 focus:outline-none focus:ring-2 focus:ring-primary-cta"
placeholder="••••••••"
/>
</div>
<div className="flex items-center justify-between">
<label className="flex items-center">
<input
type="checkbox"
className="rounded border-foreground/20 text-primary-cta focus:ring-primary-cta"
/>
<span className="ml-2 text-sm text-foreground/60">Remember me</span>
</label>
<a href="#" className="text-sm text-primary-cta hover:underline">
Forgot password?
</a>
</div>
{error && <div className="text-red-600 text-sm text-center">{error}</div>}
<button
type="submit"
disabled={isLoading}
className="w-full mt-6 bg-primary-cta text-white font-semibold py-2 rounded-lg hover:opacity-90 transition-opacity disabled:opacity-50 disabled:cursor-not-allowed"
>
{isLoading ? 'Signing in...' : 'Sign In'}
</button>
<p className="text-center text-foreground/60 text-sm">
Don&apos;t have an account?{' '}
<a href="/register" className="text-primary-cta hover:underline">
Create one
</a>
</p>
</form>
<div id="nav" data-section="nav">
<NavbarLayoutFloatingInline
navItems={navItems}
brandName="Webild"
/>
</div>
<div className="min-h-screen bg-gradient-to-br from-background to-card pt-24">
<div className="max-w-md mx-auto px-4 py-12">
<h1 className="text-4xl font-bold text-foreground mb-8 text-center">Sign In</h1>
<div className="bg-card border border-foreground/10 rounded-lg p-8">
<form className="space-y-6">
<div>
<label className="block text-sm font-medium text-foreground mb-2">Email</label>
<input type="email" className="w-full px-4 py-2 border border-foreground/20 rounded-lg bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary-cta" />
</div>
<div>
<label className="block text-sm font-medium text-foreground mb-2">Password</label>
<input type="password" className="w-full px-4 py-2 border border-foreground/20 rounded-lg bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary-cta" />
</div>
<button type="submit" className="w-full px-4 py-2 bg-primary-cta text-white rounded-lg hover:opacity-90 transition-opacity font-semibold">
Sign In
</button>
</form>
</div>
</div>
</div>
</ThemeProvider>