Improve user authentication and navigation flow
Introduce a loading state for authentication, refactor route handling to conditionally render authenticated vs. unauthenticated views, add an Auction Guide page, and update navigation links to use the Link component for client-side routing. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 069d4324-6c40-4355-955e-c714a50de1ea Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3df548ff-50ae-432f-9be4-25d34eccc983/069d4324-6c40-4355-955e-c714a50de1ea/u6Yn0uG
This commit is contained in:
@ -12,6 +12,8 @@ import { apiRequest } from "@/lib/queryClient";
|
||||
import { isUnauthorizedError } from "@/lib/authUtils";
|
||||
import AuctionCard from "@/components/AuctionCard";
|
||||
import type { Auction, MediaOutlet } from "@shared/schema";
|
||||
import { BookOpen } from "lucide-react";
|
||||
import { Link } from "wouter";
|
||||
|
||||
export default function Auctions() {
|
||||
const { user, isAuthenticated } = useAuth();
|
||||
@ -169,13 +171,14 @@ export default function Auctions() {
|
||||
</div>
|
||||
|
||||
<nav className="hidden md:flex space-x-6">
|
||||
<a href="/" className="text-muted-foreground hover:text-foreground transition-colors">Home</a>
|
||||
<a href="/auctions" className="text-foreground hover:text-primary transition-colors">Auctions</a>
|
||||
<Link href="/" className="text-muted-foreground hover:text-foreground transition-colors">Home</Link>
|
||||
<Link href="/auctions" className="text-foreground hover:text-primary transition-colors">Auctions</Link>
|
||||
<Link href="/auction-guide" className="text-muted-foreground hover:text-foreground transition-colors">Auction Guide</Link>
|
||||
<a href="#" className="text-muted-foreground hover:text-foreground transition-colors">Predictions</a>
|
||||
{(user?.role === 'admin' || user?.role === 'superadmin') && (
|
||||
<a href={user.role === 'admin' ? '/admin' : '/superadmin'} className="text-muted-foreground hover:text-foreground transition-colors">
|
||||
<Link href={user.role === 'admin' ? '/admin' : '/superadmin'} className="text-muted-foreground hover:text-foreground transition-colors">
|
||||
Dashboard
|
||||
</a>
|
||||
</Link>
|
||||
)}
|
||||
</nav>
|
||||
</div>
|
||||
@ -215,7 +218,15 @@ export default function Auctions() {
|
||||
<main className="max-w-7xl mx-auto px-6 py-8">
|
||||
{/* Page Header */}
|
||||
<div className="mb-8">
|
||||
<h1 className="text-3xl font-bold mb-4">Media Outlet Auctions</h1>
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h1 className="text-3xl font-bold">Media Outlet Auctions</h1>
|
||||
<Link href="/auction-guide">
|
||||
<Button variant="outline" data-testid="button-auction-guide">
|
||||
<BookOpen className="mr-2 h-4 w-4" />
|
||||
Complete Auction Guide
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
<p className="text-lg text-muted-foreground mb-6">
|
||||
Bid for exclusive editorial rights and content management privileges.
|
||||
Based on competitive bidding similar to advertising platforms, combining bid amount with quality scores.
|
||||
|
||||
Reference in New Issue
Block a user