Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Web Spinner] Add New Authentication Page for Login and Account Creation #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions app/login/login-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React, { useState } from 'react';
import Link from 'next/link';
import { siteConfig } from '@/config/site';
import { buttonVariants } from '@/components/ui/button';

export default function LoginPage() {
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');

const handleLogin = (e: React.FormEvent) => {
e.preventDefault();
// Handle login logic here
console.log('Login with:', username, password);
};

return (
<div className='container mx-auto p-6'>
<div className='max-w-md mx-auto bg-white p-8 rounded shadow'>
<h1 className='text-3xl font-bold mb-6'>Login</h1>
<form onSubmit={handleLogin}>
<label htmlFor='username' className='block mb-2 text-sm font-medium text-gray-700'>Username</label>
<input
type='text'
id='username'
value={username}
onChange={(e) => setUsername(e.target.value)}
className='mb-4 w-full rounded border px-3 py-2'
/>
<label htmlFor='password' className='block mb-2 text-sm font-medium text-gray-700'>Password</label>
<input
type='password'
id='password'
value={password}
onChange={(e) => setPassword(e.target.value)}
className='mb-4 w-full rounded border px-3 py-2'
/>
<button
type='submit'
className={buttonVariants({ variant: 'solid' })}
>
Login
</button>
</form>
<p className='mt-4 text-center'>
Don't have an account?
<Link href='/signup'>
<a className='text-blue-600 hover:underline'>Sign up</a>
</Link>
</p>
</div>
</div>
);
}