mirror of
https://github.com/myronblair/epic-download
synced 2026-06-30 17:51:00 -05:00
auto-commit for b6920384-e719-4360-b37b-9bb5ad6d54a6
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
import React, { useState } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Lock, Mail, Plane } from 'lucide-react';
|
||||
import { Button } from '../components/ui/button';
|
||||
import { Input } from '../components/ui/input';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../components/ui/card';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
const AdminLogin = () => {
|
||||
const [email, setEmail] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleLogin = (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
// Mock authentication - will be replaced with real backend
|
||||
if (email === 'admin@epictravel.com' && password === 'admin123') {
|
||||
localStorage.setItem('isAdminAuthenticated', 'true');
|
||||
toast.success('Login successful!');
|
||||
navigate('/admin/dashboard');
|
||||
} else {
|
||||
toast.error('Invalid credentials. Try: admin@epictravel.com / admin123');
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-gradient-to-br from-cyan-50 to-blue-100 flex items-center justify-center px-4">
|
||||
<Card className="w-full max-w-md">
|
||||
<CardHeader className="text-center">
|
||||
<div className="flex justify-center mb-4">
|
||||
<div className="bg-gradient-to-br from-cyan-500 to-blue-600 p-4 rounded-full">
|
||||
<Plane className="w-8 h-8 text-white" />
|
||||
</div>
|
||||
</div>
|
||||
<CardTitle className="text-3xl font-bold">Admin Portal</CardTitle>
|
||||
<CardDescription className="text-base">
|
||||
Sign in to manage destinations and specials
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form onSubmit={handleLogin} className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<label className="text-sm font-medium text-gray-700">Email</label>
|
||||
<div className="relative">
|
||||
<Mail className="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-5 h-5" />
|
||||
<Input
|
||||
type="email"
|
||||
placeholder="admin@epictravel.com"
|
||||
value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
className="pl-10"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<label className="text-sm font-medium text-gray-700">Password</label>
|
||||
<div className="relative">
|
||||
<Lock className="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-5 h-5" />
|
||||
<Input
|
||||
type="password"
|
||||
placeholder="Enter your password"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
className="pl-10"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<Button type="submit" className="w-full bg-cyan-600 hover:bg-cyan-700" size="lg">
|
||||
Sign In
|
||||
</Button>
|
||||
</form>
|
||||
<div className="mt-6 p-4 bg-cyan-50 rounded-lg border border-cyan-200">
|
||||
<p className="text-sm text-cyan-800">
|
||||
<strong>Demo Credentials:</strong><br />
|
||||
Email: admin@epictravel.com<br />
|
||||
Password: admin123
|
||||
</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default AdminLogin;
|
||||
Reference in New Issue
Block a user