supplier_central_frontend/src/App.tsx

50 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-08-21 05:13:19 +00:00
import React from 'react';
import { SellerProvider, useSeller } from './context/SellerContext';
import Header from './components/layout/Header';
import Footer from './components/layout/Footer';
import LandingPage from './components/pages/LandingPage';
import HowItWorksPage from './components/pages/HowItWorksPage';
import PricingPage from './components/pages/PricingPage';
import GrowBusinessPage from './components/pages/GrowBusinessPage';
2026-08-21 05:13:19 +00:00
import AboutPage from './components/pages/AboutPage';
import ContactPage from './components/pages/ContactPage';
import AuthForms from './components/pages/AuthForms';
import OnboardingWizard from './components/pages/OnboardingWizard';
import DashboardLayout from './components/dashboard/DashboardLayout';
2026-08-21 05:13:19 +00:00
function AppRouter() {
const { currentPage } = useSeller();
2026-08-21 05:13:19 +00:00
if (currentPage === 'dashboard') {
return <DashboardLayout />;
}
if (currentPage === 'home') {
return <LandingPage />;
}
return (
<div className="is-flex is-flex-direction-column" style={{ minHeight: '100vh', backgroundColor: 'var(--trad-bg)' }}>
2026-08-21 05:13:19 +00:00
<Header />
<main className="is-flex-grow-1">
{currentPage === 'how-it-works' && <HowItWorksPage />}
{currentPage === 'pricing' && <PricingPage />}
{currentPage === 'grow-business' && <GrowBusinessPage />}
2026-08-21 05:13:19 +00:00
{currentPage === 'profile-completion' && <OnboardingWizard />}
{currentPage === 'about' && <AboutPage />}
{currentPage === 'contact' && <ContactPage />}
{(currentPage === 'login' || currentPage === 'signup') && <AuthForms />}
</main>
<Footer />
</div>
);
}
2026-08-09 05:29:03 +00:00
2026-08-21 05:13:19 +00:00
export default function App() {
2026-08-09 05:29:03 +00:00
return (
2026-08-21 05:13:19 +00:00
<SellerProvider>
<AppRouter />
</SellerProvider>
);
2026-08-09 05:29:03 +00:00
}