mirror of
https://github.com/JustAnimeCore/JustAnime.git
synced 2026-04-17 13:51:44 +00:00
seo
This commit is contained in:
93
src/App.jsx
93
src/App.jsx
@@ -1,6 +1,7 @@
|
||||
import { useLocation } from "react-router-dom";
|
||||
import { useEffect } from "react";
|
||||
import { Routes, Route } from "react-router-dom";
|
||||
import { HelmetProvider } from "react-helmet-async";
|
||||
import { Analytics } from '@vercel/analytics/react';
|
||||
import { SpeedInsights } from '@vercel/speed-insights/react';
|
||||
import { HomeInfoProvider } from "./context/HomeInfoContext";
|
||||
@@ -34,51 +35,53 @@ function App() {
|
||||
const isSplashScreen = location.pathname === "/";
|
||||
|
||||
return (
|
||||
<HomeInfoProvider>
|
||||
<div className="app-container px-4 lg:px-10">
|
||||
<main className="content max-w-[2048px] mx-auto w-full">
|
||||
{!isSplashScreen && <Navbar />}
|
||||
<Routes>
|
||||
<Route path="/" element={<SplashScreen />} />
|
||||
<Route path="/home" element={<Home />} />
|
||||
<Route path="/:id" element={<AnimeInfo />} />
|
||||
<Route path="/watch/:id" element={<Watch />} />
|
||||
<Route path="/random" element={<AnimeInfo random={true} />} />
|
||||
<Route path="/404-not-found-page" element={<Error error="404" />} />
|
||||
<Route path="/error-page" element={<Error />} />
|
||||
<Route path="/terms-of-service" element={<Terms />} />
|
||||
<Route path="/dmca" element={<DMCA />} />
|
||||
<Route path="/contact" element={<Contact />} />
|
||||
{/* Render category routes */}
|
||||
{categoryRoutes.map((path) => (
|
||||
<Route
|
||||
key={path}
|
||||
path={`/${path}`}
|
||||
element={
|
||||
<Category path={path} label={path.split("-").join(" ")} />
|
||||
}
|
||||
/>
|
||||
))}
|
||||
{/* Render A to Z routes */}
|
||||
{azRoute.map((path) => (
|
||||
<Route
|
||||
key={path}
|
||||
path={`/${path}`}
|
||||
element={<AtoZ path={path} />}
|
||||
/>
|
||||
))}
|
||||
<Route path="/producer/:id" element={<Producer />} />
|
||||
<Route path="/search" element={<Search />} />
|
||||
{/* Catch-all route for 404 */}
|
||||
<Route path="*" element={<Error error="404" />} />
|
||||
</Routes>
|
||||
{!isSplashScreen && <Footer />}
|
||||
</main>
|
||||
<Analytics />
|
||||
<SpeedInsights />
|
||||
<DiscordPopup />
|
||||
</div>
|
||||
</HomeInfoProvider>
|
||||
<HelmetProvider>
|
||||
<HomeInfoProvider>
|
||||
<div className="app-container px-4 lg:px-10">
|
||||
<main className="content max-w-[2048px] mx-auto w-full">
|
||||
{!isSplashScreen && <Navbar />}
|
||||
<Routes>
|
||||
<Route path="/" element={<SplashScreen />} />
|
||||
<Route path="/home" element={<Home />} />
|
||||
<Route path="/:id" element={<AnimeInfo />} />
|
||||
<Route path="/watch/:id" element={<Watch />} />
|
||||
<Route path="/random" element={<AnimeInfo random={true} />} />
|
||||
<Route path="/404-not-found-page" element={<Error error="404" />} />
|
||||
<Route path="/error-page" element={<Error />} />
|
||||
<Route path="/terms-of-service" element={<Terms />} />
|
||||
<Route path="/dmca" element={<DMCA />} />
|
||||
<Route path="/contact" element={<Contact />} />
|
||||
{/* Render category routes */}
|
||||
{categoryRoutes.map((path) => (
|
||||
<Route
|
||||
key={path}
|
||||
path={`/${path}`}
|
||||
element={
|
||||
<Category path={path} label={path.split("-").join(" ")} />
|
||||
}
|
||||
/>
|
||||
))}
|
||||
{/* Render A to Z routes */}
|
||||
{azRoute.map((path) => (
|
||||
<Route
|
||||
key={path}
|
||||
path={`/${path}`}
|
||||
element={<AtoZ path={path} />}
|
||||
/>
|
||||
))}
|
||||
<Route path="/producer/:id" element={<Producer />} />
|
||||
<Route path="/search" element={<Search />} />
|
||||
{/* Catch-all route for 404 */}
|
||||
<Route path="*" element={<Error error="404" />} />
|
||||
</Routes>
|
||||
{!isSplashScreen && <Footer />}
|
||||
</main>
|
||||
<Analytics />
|
||||
<SpeedInsights />
|
||||
<DiscordPopup />
|
||||
</div>
|
||||
</HomeInfoProvider>
|
||||
</HelmetProvider>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user