Add /login page and fix public home page links
- Create dedicated /login page for sign up/sign in - Replace all /settings links with /login in public home - Get Started button now takes users to login page - Redirects authenticated users back to main app
This commit is contained in:
1 parent
149cfa5790
commit
e236609e94
2 files changed
+40
-4
No files matched your search
@@ -0,0 +1,36 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useAuth } from '@/context/AuthContext';
|
||||||
|
import { useEffect } from 'react';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
import Login from '@/components/Login';
|
||||||
|
import { Loader2 } from 'lucide-react';
|
||||||
|
|
||||||
|
export default function LoginPage() {
|
||||||
|
const { user, loading } = useAuth();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!loading && user) {
|
||||||
|
router.push('/');
|
||||||
|
}
|
||||||
|
}, [user, loading, router]);
|
||||||
|
|
||||||
|
if (loading) {
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900">
|
||||||
|
<Loader2 className="w-8 h-8 animate-spin text-blue-400" />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900">
|
||||||
|
<Login />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@ export default function PublicHome() {
|
|||||||
<h1 className="text-2xl font-bold text-white">Haver</h1>
|
<h1 className="text-2xl font-bold text-white">Haver</h1>
|
||||||
</div>
|
</div>
|
||||||
<Link
|
<Link
|
||||||
href="/settings"
|
href="/login"
|
||||||
className="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg font-semibold transition-colors"
|
className="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg font-semibold transition-colors"
|
||||||
>
|
>
|
||||||
Sign In
|
Sign In
|
||||||
@@ -29,7 +29,7 @@ export default function PublicHome() {
|
|||||||
and celebrate when God answers. Stay connected to your prayer life, anytime, anywhere.
|
and celebrate when God answers. Stay connected to your prayer life, anytime, anywhere.
|
||||||
</p>
|
</p>
|
||||||
<Link
|
<Link
|
||||||
href="/settings"
|
href="/login"
|
||||||
className="inline-block px-8 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-lg font-semibold transition-colors text-lg"
|
className="inline-block px-8 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-lg font-semibold transition-colors text-lg"
|
||||||
>
|
>
|
||||||
Get Started
|
Get Started
|
||||||
@@ -98,7 +98,7 @@ export default function PublicHome() {
|
|||||||
<section className="max-w-6xl mx-auto px-4 py-20 text-center">
|
<section className="max-w-6xl mx-auto px-4 py-20 text-center">
|
||||||
<h3 className="text-3xl font-bold text-white mb-6">Ready to Start Your Prayer Journey?</h3>
|
<h3 className="text-3xl font-bold text-white mb-6">Ready to Start Your Prayer Journey?</h3>
|
||||||
<Link
|
<Link
|
||||||
href="/settings"
|
href="/login"
|
||||||
className="inline-block px-8 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-lg font-semibold transition-colors text-lg"
|
className="inline-block px-8 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-lg font-semibold transition-colors text-lg"
|
||||||
>
|
>
|
||||||
Sign In Now
|
Sign In Now
|
||||||
@@ -118,7 +118,7 @@ export default function PublicHome() {
|
|||||||
<ul className="space-y-2">
|
<ul className="space-y-2">
|
||||||
<li><Link href="/privacy" className="text-slate-400 hover:text-white transition-colors">Privacy Policy</Link></li>
|
<li><Link href="/privacy" className="text-slate-400 hover:text-white transition-colors">Privacy Policy</Link></li>
|
||||||
<li><Link href="#" className="text-slate-400 hover:text-white transition-colors">Terms of Service</Link></li>
|
<li><Link href="#" className="text-slate-400 hover:text-white transition-colors">Terms of Service</Link></li>
|
||||||
<li><Link href="/settings" className="text-slate-400 hover:text-white transition-colors">Sign In</Link></li>
|
<li><Link href="/login" className="text-slate-400 hover:text-white transition-colors">Sign In</Link></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in new issue
Block a user