put the first components into the field page
This commit is contained in:
parent
1588905a04
commit
1fbc817abe
4 changed files with 159 additions and 5 deletions
|
|
@ -47,6 +47,7 @@ const Contract = lazy(() => import("pages/Contract"));
|
|||
const JohnDeere = lazy(() => import("pages/JohnDeere"));
|
||||
const CNHi = lazy(() => import("pages/CNHi"));
|
||||
const LibraCart = lazy(() => import("pages/LibraCart"));
|
||||
const FieldPage = lazy(()=>import("pages/Field"));
|
||||
|
||||
export const appendToUrl = (appendage: number | string) => {
|
||||
const basePath = location.pathname.replace(/\/$/, "");
|
||||
|
|
@ -70,6 +71,7 @@ export default function Router() {
|
|||
<Route path="terminals/*" element={<TerminalGatesRoute />} />
|
||||
<Route path="jobsites/*" element={<JobsitesRoute />} />
|
||||
<Route path="heaters/*" element={<ObjectHeatersRoute />} />
|
||||
<Route path="fields/*" element={<FieldsRoute />} />
|
||||
</Routes>
|
||||
)
|
||||
}
|
||||
|
|
@ -284,6 +286,21 @@ export default function Router() {
|
|||
);
|
||||
};
|
||||
|
||||
const FieldsRoute = () => {
|
||||
return (
|
||||
<Routes>
|
||||
<Route
|
||||
path=""
|
||||
element={<Fields />}
|
||||
/>
|
||||
<Route
|
||||
path="/:fieldID"
|
||||
element={<FieldPage />}
|
||||
/>
|
||||
</Routes>
|
||||
);
|
||||
}
|
||||
|
||||
if (isLoading) return null;
|
||||
// if (!isAuthenticated) {
|
||||
// loginWithRedirect()
|
||||
|
|
@ -325,7 +342,6 @@ export default function Router() {
|
|||
{user.hasFeature("admin") &&
|
||||
<Route path="logs" element={<Logs />} />
|
||||
}
|
||||
<Route path="fields" element={<Fields />} />
|
||||
<Route path="marketplace" element={<Marketplace />} />
|
||||
{user.hasFeature("admin") && (
|
||||
<Route path="firmware" element={<Firmware />} />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue