Update home and landing pages to show consistent UI regardless of login status
Refactor routing and page components to ensure the main content is displayed identically for both logged-in and logged-out users, removing conditional rendering based on authentication status in the main router and consolidating content display logic into a new `MainContent` component. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 069d4324-6c40-4355-955e-c714a50de1ea Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3df548ff-50ae-432f-9be4-25d34eccc983/069d4324-6c40-4355-955e-c714a50de1ea/InMLMqG
This commit is contained in:
@ -15,28 +15,14 @@ import AuctionGuide from "@/pages/AuctionGuide";
|
||||
import NotFound from "@/pages/not-found";
|
||||
|
||||
function Router() {
|
||||
const { isAuthenticated, isLoading, user } = useAuth();
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="min-h-screen bg-background flex items-center justify-center">
|
||||
<div className="text-center">
|
||||
<div className="animate-spin rounded-full h-32 w-32 border-b-2 border-primary mx-auto mb-4"></div>
|
||||
<p className="text-lg">Loading...</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Debug logging
|
||||
console.log('Router render - isAuthenticated:', isAuthenticated, 'user:', user);
|
||||
const { isAuthenticated, user } = useAuth();
|
||||
|
||||
return (
|
||||
<Switch>
|
||||
<Route path="/" component={isAuthenticated ? Home : Landing} />
|
||||
<Route path="/media/:slug" component={isAuthenticated ? MediaOutlet : Landing} />
|
||||
<Route path="/articles/:slug" component={isAuthenticated ? Article : Landing} />
|
||||
<Route path="/auctions" component={isAuthenticated ? Auctions : Landing} />
|
||||
<Route path="/media/:slug" component={MediaOutlet} />
|
||||
<Route path="/articles/:slug" component={Article} />
|
||||
<Route path="/auctions" component={Auctions} />
|
||||
<Route path="/auction-guide" component={AuctionGuide} />
|
||||
|
||||
{/* Admin routes - only when authenticated */}
|
||||
|
||||
Reference in New Issue
Block a user