Add core UI components and layout for media platform
Initializes the client-side application with fundamental UI components, including navigation, cards for articles and auctions, and various elements for user interaction and display. 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/bVdKIaU
This commit is contained in:
53
client/src/App.tsx
Normal file
53
client/src/App.tsx
Normal file
@ -0,0 +1,53 @@
|
||||
import { Switch, Route } from "wouter";
|
||||
import { queryClient } from "./lib/queryClient";
|
||||
import { QueryClientProvider } from "@tanstack/react-query";
|
||||
import { Toaster } from "@/components/ui/toaster";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import { useAuth } from "@/hooks/useAuth";
|
||||
import Landing from "@/pages/Landing";
|
||||
import Home from "@/pages/Home";
|
||||
import MediaOutlet from "@/pages/MediaOutlet";
|
||||
import Article from "@/pages/Article";
|
||||
import AdminDashboard from "@/pages/AdminDashboard";
|
||||
import SuperAdminDashboard from "@/pages/SuperAdminDashboard";
|
||||
import Auctions from "@/pages/Auctions";
|
||||
import NotFound from "@/pages/not-found";
|
||||
|
||||
function Router() {
|
||||
const { isAuthenticated, isLoading, user } = useAuth();
|
||||
|
||||
return (
|
||||
<Switch>
|
||||
{isLoading || !isAuthenticated ? (
|
||||
<Route path="/" component={Landing} />
|
||||
) : (
|
||||
<>
|
||||
<Route path="/" component={Home} />
|
||||
<Route path="/media/:slug" component={MediaOutlet} />
|
||||
<Route path="/articles/:slug" component={Article} />
|
||||
<Route path="/auctions" component={Auctions} />
|
||||
{user?.role === 'admin' && (
|
||||
<Route path="/admin" component={AdminDashboard} />
|
||||
)}
|
||||
{user?.role === 'superadmin' && (
|
||||
<Route path="/superadmin" component={SuperAdminDashboard} />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<Route component={NotFound} />
|
||||
</Switch>
|
||||
);
|
||||
}
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<TooltipProvider>
|
||||
<Toaster />
|
||||
<Router />
|
||||
</TooltipProvider>
|
||||
</QueryClientProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
Reference in New Issue
Block a user