This commit is contained in:
Dave Richer
2023-12-06 17:35:27 -05:00
parent a043f7be24
commit 5c164f807d
68 changed files with 279 additions and 294 deletions

View File

@@ -2,7 +2,7 @@ import { BackTop, Layout } from "antd";
import React, { Suspense, lazy, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { Redirect, Route, Switch } from "react-router-dom";
import { useNavigate, Route, Routes } from "react-router-dom";
import { createStructuredSelector } from "reselect";
import ErrorBoundary from "../../components/error-boundary/error-boundary.component";
@@ -50,16 +50,18 @@ const mapDispatchToProps = (dispatch) => ({
export function TechPage({ technician, match }) {
const { t } = useTranslation();
const navigate = useNavigate();
useEffect(() => {
document.title = t("titles.app");
}, [t]);
if (!technician) return navigate(`${match.path}/login`
);
return (
<Layout className="tech-layout-container">
<TechSider />
<Layout>
{technician ? null : <Redirect to={`${match.path}/login`} />}
<UpdateAlert />
<TechHeader />
@@ -74,7 +76,7 @@ export function TechPage({ technician, match }) {
<TimeTicketModalContainer />
<EmailOverlayContainer />
<PrintCenterModalContainer />
<Switch>
<Routes>
<Route
exact
path={`${match.path}/login`}
@@ -105,7 +107,7 @@ export function TechPage({ technician, match }) {
path={`${match.path}/board`}
component={ProductionBoardPage}
/>
</Switch>
</Routes>
</FeatureWrapper>
</Suspense>
</ErrorBoundary>