Import source: cshare-app/src/App
Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
/* App-level styles are in index.css */
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
import { lazy, Suspense } from 'react';
|
||||||
|
import { BrowserRouter, Routes, Route, useLocation } from 'react-router-dom';
|
||||||
|
import Navbar from './components/Navbar';
|
||||||
|
import Footer from './components/Footer';
|
||||||
|
import { ToastProvider } from './components/Toast';
|
||||||
|
import PageTransition from './components/PageTransition';
|
||||||
|
import { useLenis } from './hooks/useLenis';
|
||||||
|
import ErrorBoundary from './components/ErrorBoundary';
|
||||||
|
|
||||||
|
const LandingPage = lazy(() => import('./pages/LandingPage'));
|
||||||
|
const UploadPage = lazy(() => import('./pages/UploadPage'));
|
||||||
|
const FileViewPage = lazy(() => import('./pages/FileViewPage'));
|
||||||
|
const DashboardPage = lazy(() => import('./pages/DashboardPage'));
|
||||||
|
const PricingPage = lazy(() => import('./pages/PricingPage'));
|
||||||
|
const DocsPage = lazy(() => import('./pages/DocsPage'));
|
||||||
|
const AboutPage = lazy(() => import('./pages/AboutPage'));
|
||||||
|
const BlogPage = lazy(() => import('./pages/BlogPage'));
|
||||||
|
const CareersPage = lazy(() => import('./pages/CareersPage'));
|
||||||
|
const ContactPage = lazy(() => import('./pages/ContactPage'));
|
||||||
|
const PrivacyPage = lazy(() => import('./pages/PrivacyPage'));
|
||||||
|
const TermsPage = lazy(() => import('./pages/TermsPage'));
|
||||||
|
const SecurityPage = lazy(() => import('./pages/SecurityPage'));
|
||||||
|
const GdprPage = lazy(() => import('./pages/GdprPage'));
|
||||||
|
const NotFoundPage = lazy(() => import('./pages/NotFoundPage'));
|
||||||
|
|
||||||
|
const HIDE_FOOTER = ['/', '/preview'];
|
||||||
|
|
||||||
|
function PageFallback() {
|
||||||
|
return (
|
||||||
|
<div style={{
|
||||||
|
minHeight: '60vh',
|
||||||
|
display: 'grid',
|
||||||
|
placeItems: 'center',
|
||||||
|
color: 'var(--text-muted)',
|
||||||
|
fontFamily: 'var(--font-heading)',
|
||||||
|
}}>
|
||||||
|
Loading...
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function AppShell() {
|
||||||
|
const { pathname } = useLocation();
|
||||||
|
useLenis();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="noise-overlay">
|
||||||
|
<Navbar />
|
||||||
|
<main style={{ flex: 1 }}>
|
||||||
|
<Suspense fallback={<PageFallback />}>
|
||||||
|
<ErrorBoundary>
|
||||||
|
<PageTransition>
|
||||||
|
<Routes>
|
||||||
|
<Route path="/" element={<LandingPage />} />
|
||||||
|
<Route path="/upload" element={<UploadPage />} />
|
||||||
|
<Route path="/dashboard" element={<DashboardPage />} />
|
||||||
|
<Route path="/preview" element={<FileViewPage />} />
|
||||||
|
<Route path="/preview/:linkId" element={<FileViewPage />} />
|
||||||
|
<Route path="/pricing" element={<PricingPage />} />
|
||||||
|
<Route path="/docs" element={<DocsPage />} />
|
||||||
|
<Route path="/about" element={<AboutPage />} />
|
||||||
|
<Route path="/blog" element={<BlogPage />} />
|
||||||
|
<Route path="/careers" element={<CareersPage />} />
|
||||||
|
<Route path="/contact" element={<ContactPage />} />
|
||||||
|
<Route path="/privacy" element={<PrivacyPage />} />
|
||||||
|
<Route path="/terms" element={<TermsPage />} />
|
||||||
|
<Route path="/security" element={<SecurityPage />} />
|
||||||
|
<Route path="/gdpr" element={<GdprPage />} />
|
||||||
|
<Route path="*" element={<NotFoundPage />} />
|
||||||
|
</Routes>
|
||||||
|
</PageTransition>
|
||||||
|
</ErrorBoundary>
|
||||||
|
</Suspense>
|
||||||
|
</main>
|
||||||
|
{!HIDE_FOOTER.some((path) => pathname === path || pathname.startsWith(`${path}/`)) && <Footer />}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
return (
|
||||||
|
<ErrorBoundary>
|
||||||
|
<BrowserRouter>
|
||||||
|
<ToastProvider>
|
||||||
|
<AppShell />
|
||||||
|
</ToastProvider>
|
||||||
|
</BrowserRouter>
|
||||||
|
</ErrorBoundary>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App;
|
||||||
Reference in New Issue
Block a user