feat: ( auth ) restore sign in/register UI in nav bar, sidebar, and auth-check

This commit is contained in:
Abubeker Yasin
2026-07-14 21:09:49 +03:00
parent c8fe2a78f8
commit 7d64c91915
3 changed files with 12 additions and 17 deletions

View File

@@ -4,7 +4,7 @@ import { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation'; import { useRouter } from 'next/navigation';
import { useAuthStore } from '@/lib/auth-store'; import { useAuthStore } from '@/lib/auth-store';
import { useBookingStore } from '@/lib/booking-store'; import { useBookingStore } from '@/lib/booking-store';
import { UserPlus, ChevronLeft } from 'lucide-react'; import { UserPlus, LogIn, ChevronLeft } from 'lucide-react';
function Tooltip({ children, content }: { children: React.ReactNode; content: string[] }) { function Tooltip({ children, content }: { children: React.ReactNode; content: string[] }) {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
@@ -95,7 +95,6 @@ export default function AuthCheckPage() {
</button> </button>
</Tooltip> </Tooltip>
{/* TODO: re-enable once auth is integrated
<Tooltip content={[ <Tooltip content={[
'Saved passenger details', 'Saved passenger details',
'View booking history', 'View booking history',
@@ -109,7 +108,6 @@ export default function AuthCheckPage() {
SignIn or Register SignIn or Register
</button> </button>
</Tooltip> </Tooltip>
*/}
</div> </div>
<div className="mt-8 text-center"> <div className="mt-8 text-center">

View File

@@ -192,9 +192,7 @@ export default function AppSidebar() {
)} )}
</div> </div>
) : ( ) : (
// TODO: Sign in / Register temporarily disabled — re-enable later. <div className="flex items-center gap-2 px-1 pt-1">
null
/* <div className="flex items-center gap-2 px-1 pt-1">
<Link <Link
href="/login" href="/login"
className="flex-1 text-center px-3 py-2 text-sm font-medium text-gray-100 hover:bg-white/10 rounded-lg transition-colors" className="flex-1 text-center px-3 py-2 text-sm font-medium text-gray-100 hover:bg-white/10 rounded-lg transition-colors"
@@ -207,7 +205,7 @@ export default function AppSidebar() {
> >
Register Register
</Link> </Link>
</div> */ </div>
)} )}
</div> </div>

View File

@@ -1,10 +1,9 @@
'use client'; 'use client';
// NOTE: User icon + useAuthStore are unused while the Sign in / Account tab is import { Home, Phone, Ticket, User } from 'lucide-react';
// temporarily disabled below. Re-add them when that tab is restored.
import { Home, Phone, Ticket } from 'lucide-react';
import Link from 'next/link'; import Link from 'next/link';
import { usePathname } from 'next/navigation'; import { usePathname } from 'next/navigation';
import { useAuthStore } from '@/lib/auth-store';
// The linear, one-screen-at-a-time booking flow — each of these pages already // The linear, one-screen-at-a-time booking flow — each of these pages already
// has its own sticky mobile CTA bar (and the mobile step strip at the top), // has its own sticky mobile CTA bar (and the mobile step strip at the top),
@@ -22,6 +21,7 @@ const LINEAR_FLOW_PREFIXES = [
export default function BottomTabBar() { export default function BottomTabBar() {
const pathname = usePathname() ?? ''; const pathname = usePathname() ?? '';
const isAuthenticated = useAuthStore((s) => s.isAuthenticated);
const isInLinearFlow = LINEAR_FLOW_PREFIXES.some((p) => pathname.startsWith(p)); const isInLinearFlow = LINEAR_FLOW_PREFIXES.some((p) => pathname.startsWith(p));
if (isInLinearFlow) return null; if (isInLinearFlow) return null;
@@ -30,13 +30,12 @@ export default function BottomTabBar() {
{ href: '/', label: 'Home', icon: Home, match: (p: string) => p === '/' }, { href: '/', label: 'Home', icon: Home, match: (p: string) => p === '/' },
{ href: '/booking/lookup', label: 'Bookings', icon: Ticket, match: (p: string) => p.startsWith('/booking/lookup') || p.startsWith('/booking/detail') }, { href: '/booking/lookup', label: 'Bookings', icon: Ticket, match: (p: string) => p.startsWith('/booking/lookup') || p.startsWith('/booking/detail') },
{ href: '/contact', label: 'Contact', icon: Phone, match: (p: string) => p.startsWith('/contact') }, { href: '/contact', label: 'Contact', icon: Phone, match: (p: string) => p.startsWith('/contact') },
// TODO: Sign in / Account tab temporarily disabled — re-enable later. {
// { href: isAuthenticated ? '/profile' : '/login',
// href: isAuthenticated ? '/profile' : '/login', label: isAuthenticated ? 'Account' : 'Sign in',
// label: isAuthenticated ? 'Account' : 'Sign in', icon: User,
// icon: User, match: (p: string) => p.startsWith('/profile') || p.startsWith('/login') || p.startsWith('/register'),
// match: (p: string) => p.startsWith('/profile') || p.startsWith('/login') || p.startsWith('/register'), },
// },
]; ];
return ( return (