diff --git a/frontend/src/components/auth/LoginForm.tsx b/frontend/src/components/auth/LoginForm.tsx index ae5ad0e..d9b3a2c 100644 --- a/frontend/src/components/auth/LoginForm.tsx +++ b/frontend/src/components/auth/LoginForm.tsx @@ -1,103 +1,63 @@ -import { useState } from 'react'; -import { useAuth } from '../../contexts/AuthContext'; -import { useNavigate, Link } from 'react-router-dom'; -import { Button } from '../ui/button'; -import { Input } from '../ui/input'; -import { Label } from '../ui/label'; -import { Alert, AlertDescription } from '../ui/alert'; - -// Icons -const CodeIntelLogo = () => ( -
- CI -
-) - -const GitHubIcon = () => ( - - - -) - -const SparklesIcon = () => ( - - - -) +import { useState } from 'react' +import { useAuth } from '@/contexts/AuthContext' +import { useNavigate, Link } from 'react-router-dom' +import { Button } from '@/components/ui/button' +import { Input } from '@/components/ui/input' +import { Label } from '@/components/ui/label' +import { Alert, AlertDescription } from '@/components/ui/alert' +import { Navbar } from '@/components/landing' +import { Github, Loader2, Mail, Lock } from 'lucide-react' export function LoginForm() { - const [email, setEmail] = useState(''); - const [password, setPassword] = useState(''); - const [error, setError] = useState(''); - const [loading, setLoading] = useState(false); - const { signIn } = useAuth(); - const navigate = useNavigate(); + const [email, setEmail] = useState('') + const [password, setPassword] = useState('') + const [error, setError] = useState('') + const [loading, setLoading] = useState(false) + const { signIn } = useAuth() + const navigate = useNavigate() const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault(); - setError(''); - setLoading(true); + e.preventDefault() + setError('') + setLoading(true) try { - await signIn(email, password); - navigate('/dashboard'); + await signIn(email, password) + navigate('/dashboard') } catch (err: any) { - setError(err.message || 'Login failed'); + setError(err.message || 'Login failed') } finally { - setLoading(false); + setLoading(false) } - }; + } return ( -
- {/* Navigation */} - +
+ - {/* Main Content */}
-
- {/* Header */} +
-
- - Welcome back -
-

+

Sign in to CodeIntel

-

- Continue your AI-powered code exploration +

+ Enter your credentials to continue

- {/* Login Card */} -
-
-
-
- {error && ( - - {error} - - )} +
+ + {error && ( + + {error} + + )} -
- +
+ +
+ setEmail(e.target.value)} required disabled={loading} - className="bg-white/5 border-white/10 text-white placeholder:text-gray-500 focus:border-blue-500/50 focus:ring-blue-500/20 h-12 rounded-xl" + className="pl-10 h-10" />
+
-
-
- - -
+
+
+ + +
+
+
- - - - - {/* Divider */} -
-
-
-
-
- or continue with -
- {/* Social Login */} + + +
+
+
+
+
+ or +
+ +
- {/* Sign up link */} -

+

Don't have an account?{' '} - - Sign up for free + + Sign up

- ); + ) } diff --git a/frontend/src/components/auth/SignupForm.tsx b/frontend/src/components/auth/SignupForm.tsx index becf7c6..79bdb94 100644 --- a/frontend/src/components/auth/SignupForm.tsx +++ b/frontend/src/components/auth/SignupForm.tsx @@ -1,137 +1,74 @@ -import { useState } from 'react'; -import { useAuth } from '../../contexts/AuthContext'; -import { useNavigate, Link } from 'react-router-dom'; -import { Button } from '../ui/button'; -import { Input } from '../ui/input'; -import { Label } from '../ui/label'; -import { Alert, AlertDescription } from '../ui/alert'; - -// Icons -const CodeIntelLogo = () => ( -
- CI -
-) - -const GitHubIcon = () => ( - - - -) - -const RocketIcon = () => ( - - - -) - -const CheckIcon = () => ( - - - -) +import { useState } from 'react' +import { useAuth } from '@/contexts/AuthContext' +import { useNavigate, Link } from 'react-router-dom' +import { Button } from '@/components/ui/button' +import { Input } from '@/components/ui/input' +import { Label } from '@/components/ui/label' +import { Alert, AlertDescription } from '@/components/ui/alert' +import { Navbar } from '@/components/landing' +import { Github, Loader2, Mail, Lock } from 'lucide-react' export function SignupForm() { - const [email, setEmail] = useState(''); - const [password, setPassword] = useState(''); - const [confirmPassword, setConfirmPassword] = useState(''); - const [error, setError] = useState(''); - const [loading, setLoading] = useState(false); - const { signUp } = useAuth(); - const navigate = useNavigate(); + const [email, setEmail] = useState('') + const [password, setPassword] = useState('') + const [confirmPassword, setConfirmPassword] = useState('') + const [error, setError] = useState('') + const [loading, setLoading] = useState(false) + const { signUp } = useAuth() + const navigate = useNavigate() const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault(); - setError(''); + e.preventDefault() + setError('') if (password !== confirmPassword) { - setError('Passwords do not match'); - return; + setError('Passwords do not match') + return } if (password.length < 6) { - setError('Password must be at least 6 characters'); - return; + setError('Password must be at least 6 characters') + return } - setLoading(true); + setLoading(true) try { - await signUp(email, password); - navigate('/dashboard'); + await signUp(email, password) + navigate('/dashboard') } catch (err: any) { - setError(err.message || 'Signup failed'); + setError(err.message || 'Signup failed') } finally { - setLoading(false); + setLoading(false) } - }; - - const features = [ - 'Unlimited semantic code search', - 'Index your private repositories', - 'AI-powered code analysis', - 'MCP integration with Claude' - ]; + } return ( -
- {/* Navigation */} - +
+ - {/* Main Content */}
-
- {/* Header */} +
-
- - Get started for free -
-

+

Create your account

-

- Start searching code by meaning, not keywords +

+ Free for open source projects

- {/* Features */} -
- {features.map((feature, idx) => ( -
- - {feature} -
- ))} -
- - {/* Signup Card */} -
-
-
-
- {error && ( - - {error} - - )} - -
- +
+ + {error && ( + + {error} + + )} + +
+ +
+ setEmail(e.target.value)} required disabled={loading} - className="bg-white/5 border-white/10 text-white placeholder:text-gray-500 focus:border-blue-500/50 focus:ring-blue-500/20 h-12 rounded-xl" + className="pl-10 h-10" />
+
-
- +
+ +
+ setPassword(e.target.value)} required minLength={6} disabled={loading} - className="bg-white/5 border-white/10 text-white placeholder:text-gray-500 focus:border-blue-500/50 focus:ring-blue-500/20 h-12 rounded-xl" + className="pl-10 h-10" /> -

Must be at least 6 characters

+
-
- +
+ +
+
+
- - -

- By signing up, you agree to our Terms of Service and Privacy Policy -

- + + +

+ By signing up, you agree to our{' '} + Terms + {' '}and{' '} + Privacy Policy +

+ + +
+
+
+
+
+ or +
+ +
- {/* Sign in link */} -

+

Already have an account?{' '} - + Sign in

- ); + ) }