react-router-dom

This commit is contained in:
2024-05-04 14:58:19 +03:00
parent bb49021fb8
commit 1db1a2efce
11 changed files with 127 additions and 31 deletions
+16
View File
@@ -0,0 +1,16 @@
import React from 'react';
import { Routes, Route } from'react-router-dom';
import { URLs } from './__data__/urls';
import { LandingPage } from './pages/landing';
import { SearchCharacterPage } from './pages/search-character';
export const PageRoutes = () => (
<Routes>
<Route path={URLs.ui.charDetail.url} element={<LandingPage />} />
<Route path={URLs.baseUrl} element={<LandingPage />} />
{URLs.ui.search && <Route path={URLs.ui.search} element={<SearchCharacterPage />} />}
<Route path="*" element={<h1>Page not found</h1>} />
</Routes>
)