Switch to version 1: remove src/app/login/page.tsx

This commit is contained in:
2026-03-10 15:40:14 +00:00
parent c132227218
commit 4c5f4f2d91

View File

@@ -1,153 +0,0 @@
"use client";
import Link from "next/link";
import { useState } from "react";
import NavbarStyleApple from "@/components/navbar/NavbarStyleApple/NavbarStyleApple";
import Input from "@/components/form/Input";
import ButtonExpandHover from "@/components/button/ButtonExpandHover";
import FooterCard from "@/components/sections/footer/FooterCard";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import { Mail, Lock, Twitter, Linkedin } from "lucide-react";
const navItems = [
{ name: "Home", id: "/" },
{ name: "Workshops", id: "/workshops" },
{ name: "Classes", id: "/classes" },
{ name: "Pricing", id: "/pricing" },
{ name: "Contact", id: "/contact" },
];
export default function LoginPage() {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [loading, setLoading] = useState(false);
const [error, setError] = useState("");
const handleLogin = async (e: React.FormEvent) => {
e.preventDefault();
setLoading(true);
setError("");
try {
// Placeholder for login logic
console.log("Login attempt with:", { email, password });
// Add your login API call here
} catch (err) {
setError("Login failed. Please try again.");
} finally {
setLoading(false);
}
};
return (
<ThemeProvider
defaultButtonVariant="shift-hover"
defaultTextAnimation="entrance-slide"
borderRadius="pill"
contentWidth="medium"
sizing="mediumLarge"
background="circleGradient"
cardStyle="glass-depth"
primaryButtonStyle="radial-glow"
secondaryButtonStyle="glass"
headingFontWeight="light"
>
<div id="nav" data-section="nav">
<NavbarStyleApple brandName="ClassHub" navItems={navItems} />
</div>
<div className="min-h-screen flex items-center justify-center px-4 py-20">
<div className="w-full max-w-md">
<div className="mb-8 text-center">
<h1 className="text-4xl font-bold mb-2">Welcome Back</h1>
<p className="text-foreground/70">Sign in to your ClassHub account</p>
</div>
<form onSubmit={handleLogin} className="space-y-6">
{error && (
<div className="bg-red-500/10 border border-red-500/20 rounded-lg p-4 text-red-600 text-sm">
{error}
</div>
)}
<div>
<label className="block text-sm font-medium mb-2">Email Address</label>
<Input
type="email"
value={email}
onChange={(value) => setEmail(value)}
placeholder="you@example.com"
required
/>
</div>
<div>
<label className="block text-sm font-medium mb-2">Password</label>
<Input
type="password"
value={password}
onChange={(value) => setPassword(value)}
placeholder="Enter your password"
required
/>
</div>
<div className="flex items-center justify-between text-sm">
<label className="flex items-center">
<input type="checkbox" className="mr-2" />
<span>Remember me</span>
</label>
<Link href="/forgot-password" className="text-primary-cta hover:underline">
Forgot password?
</Link>
</div>
<button
type="submit"
disabled={loading}
className="w-full bg-primary-cta text-background py-3 rounded-lg font-medium hover:opacity-90 transition disabled:opacity-50"
>
{loading ? "Signing in..." : "Sign In"}
</button>
</form>
<div className="mt-6 text-center text-sm">
<p className="text-foreground/70">
Don't have an account?{" "}
<Link href="/register" className="text-primary-cta hover:underline font-medium">
Create one here
</Link>
</p>
</div>
<div className="mt-8 pt-8 border-t border-foreground/10">
<p className="text-center text-sm text-foreground/50 mb-4">Or continue with</p>
<div className="flex gap-4 justify-center">
<button className="flex-1 py-2 px-4 rounded-lg bg-card hover:bg-card/80 transition text-sm font-medium">
Google
</button>
<button className="flex-1 py-2 px-4 rounded-lg bg-card hover:bg-card/80 transition text-sm font-medium">
GitHub
</button>
</div>
</div>
</div>
</div>
<div id="footer" data-section="footer">
<FooterCard
logoText="ClassHub"
copyrightText="© 2025 ClassHub. All rights reserved. Empowering learners worldwide."
socialLinks={[
{
icon: Twitter,
href: "https://twitter.com/classhub", ariaLabel: "Follow ClassHub on Twitter"},
{
icon: Linkedin,
href: "https://linkedin.com/company/classhub", ariaLabel: "Follow ClassHub on LinkedIn"},
]}
/>
</div>
</ThemeProvider>
);
}