- SellItemPage: real file upload + API listing creation + activate - CreateProfilePage: save profile via PUT /users/profile - ProductDetailPage: wire edit/delete/message buttons, show edit for owner - ListingCard: persist favorites via API, show real images - Footer: connect newsletter subscribe to API - Router: add /dashboard/listings and /dashboard/saved routes - Backend: add GET /listings/favorites endpoint - New pages: MyListingsPage, SavedItemsPage - Fix unused imports causing build failures Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
48 lines
2.1 KiB
TypeScript
48 lines
2.1 KiB
TypeScript
import { createBrowserRouter } from 'react-router-dom';
|
|
import { App } from './App';
|
|
import { DashboardLayout } from './components/layout/DashboardLayout';
|
|
import { RequireAuth } from './components/layout/RequireAuth';
|
|
import { HomePage } from './pages/HomePage';
|
|
import { LoginPage } from './pages/LoginPage';
|
|
import { SignUpPage } from './pages/SignUpPage';
|
|
import { SellItemPage } from './pages/SellItemPage';
|
|
import { ProductDetailPage } from './pages/ProductDetailPage';
|
|
import { CreateProfilePage } from './pages/CreateProfilePage';
|
|
import { UpdateProfilePage } from './pages/UpdateProfilePage';
|
|
import { ChatPage } from './pages/ChatPage';
|
|
import { MyOffersPage } from './pages/MyOffersPage';
|
|
import { NotificationsPage } from './pages/NotificationsPage';
|
|
import { SoldItemsPage } from './pages/SoldItemsPage';
|
|
import { SettingsPage } from './pages/SettingsPage';
|
|
import { MyListingsPage } from './pages/MyListingsPage';
|
|
import { SavedItemsPage } from './pages/SavedItemsPage';
|
|
|
|
export const router = createBrowserRouter([
|
|
{
|
|
path: '/',
|
|
element: <App />,
|
|
children: [
|
|
{ index: true, element: <HomePage /> },
|
|
{ path: 'login', element: <LoginPage /> },
|
|
{ path: 'signup', element: <SignUpPage /> },
|
|
{ path: 'sell', element: <RequireAuth><SellItemPage /></RequireAuth> },
|
|
{ path: 'listings/:id', element: <ProductDetailPage /> },
|
|
{ path: 'profile/create', element: <RequireAuth><CreateProfilePage /></RequireAuth> },
|
|
{ path: 'profile/edit', element: <RequireAuth><UpdateProfilePage /></RequireAuth> },
|
|
{
|
|
path: 'dashboard',
|
|
element: <RequireAuth><DashboardLayout /></RequireAuth>,
|
|
children: [
|
|
{ path: 'messages', element: <ChatPage /> },
|
|
{ path: 'offers', element: <MyOffersPage /> },
|
|
{ path: 'notifications', element: <NotificationsPage /> },
|
|
{ path: 'sold', element: <SoldItemsPage /> },
|
|
{ path: 'settings', element: <SettingsPage /> },
|
|
{ path: 'listings', element: <MyListingsPage /> },
|
|
{ path: 'saved', element: <SavedItemsPage /> },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
]);
|