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:
kimjaehyeon0101
2025-09-29 16:40:42 +00:00
parent 3543b85699
commit 5a6d98208d
4 changed files with 205 additions and 205 deletions

View File

@ -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 */}