mirror of
https://github.com/Mastermindzh/react-starter-kit.git
synced 2025-02-01 08:12:31 +01:00
Mastermindzh
b9d3025163
Added an example of an authentication protected page (tenders) Added an example with the built in proxy (to combat CORS) (tendersguru)
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
import { OidcSecure } from "@axa-fr/react-oidc";
|
|
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 { Tenders } from "./features/examples/tenders/Tenders";
|
|
import { HomeContainer } from "./features/home/Home";
|
|
type Props = {};
|
|
|
|
export const ROUTE_KEYS = {
|
|
home: "",
|
|
about: "about",
|
|
counter: "counter",
|
|
tenders: "tenders",
|
|
};
|
|
|
|
export const AppRoutes: FunctionComponent<Props> = () => {
|
|
const { home, about, counter, tenders } = ROUTE_KEYS;
|
|
return (
|
|
<Routes>
|
|
<Route path={home} element={<HomeContainer />} />
|
|
<Route path={about} element={<AboutContainer />} />
|
|
<Route path={counter} element={<CounterContainer />} />
|
|
{/* a route with authentication */}
|
|
<Route
|
|
path={tenders}
|
|
element={
|
|
<OidcSecure>
|
|
<Tenders />
|
|
</OidcSecure>
|
|
}
|
|
/>
|
|
{/* <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>
|
|
);
|
|
};
|