mirror of
https://github.com/Mastermindzh/react-starter-kit.git
synced 2025-08-23 17:44:52 +02:00
Moved examples into example directory
Moved routes to separate file Used route constants
This commit is contained in:
30
src/Routes.tsx
Normal file
30
src/Routes.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { FunctionComponent } from "react";
|
||||
import { Route, Routes } from "react-router-dom";
|
||||
import { AboutContainer } from "./features/about/About";
|
||||
import { CounterContainer } from "./features/examples/counter/Counter";
|
||||
import { HomeContainer } from "./features/home/Home";
|
||||
type Props = {};
|
||||
|
||||
export const ROUTE_KEYS = {
|
||||
home: "",
|
||||
about: "about",
|
||||
counter: "counter",
|
||||
};
|
||||
|
||||
export const AppRoutes: FunctionComponent<Props> = () => {
|
||||
const { home, about, counter } = ROUTE_KEYS;
|
||||
return (
|
||||
<Routes>
|
||||
<Route path={home} element={<HomeContainer />} />
|
||||
<Route path={about} element={<AboutContainer />} />
|
||||
<Route path={counter} element={<CounterContainer />} />
|
||||
{/* <Route index element={<Home />} /> */}
|
||||
{/* <Route path="teams" element={<Teams />}>
|
||||
<Route path=":teamId" element={<Team />} />
|
||||
<Route path="new" element={<NewTeamForm />} />
|
||||
<Route index element={<LeagueStandings />} />
|
||||
</Route> */}
|
||||
{/* </Route> */}
|
||||
</Routes>
|
||||
);
|
||||
};
|
Reference in New Issue
Block a user