Progress
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user