Added tech routing paths and basic structure of landing page + sign in + reducers BOD-95
This commit is contained in:
70
client/src/pages/tech/tech.page.component.jsx
Normal file
70
client/src/pages/tech/tech.page.component.jsx
Normal file
@@ -0,0 +1,70 @@
|
||||
import { BackTop, Layout } from "antd";
|
||||
import React, { lazy, Suspense, useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import ErrorBoundary from "../../components/error-boundary/error-boundary.component";
|
||||
import FcmNotification from "../../components/fcm-notification/fcm-notification.component";
|
||||
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
|
||||
import TechHeader from "../../components/tech-header/tech-header.component";
|
||||
import TechSider from "../../components/tech-sider/tech-sider.component";
|
||||
import "./tech.page.styles.scss";
|
||||
|
||||
const ManageRootPage = lazy(() =>
|
||||
import("../manage-root/manage-root.page.container")
|
||||
);
|
||||
const JobsPage = lazy(() => import("../jobs/jobs.page"));
|
||||
|
||||
const TimeTicketModalContainer = lazy(() =>
|
||||
import("../../components/time-ticket-modal/time-ticket-modal.container")
|
||||
);
|
||||
const PrintCenterModalContainer = lazy(() =>
|
||||
import("../../components/print-center-modal/print-center-modal.container")
|
||||
);
|
||||
const TechLogin = lazy(() =>
|
||||
import("../../components/tech-login/tech-login.component")
|
||||
);
|
||||
|
||||
const { Content } = Layout;
|
||||
|
||||
export default function TechPage({ match }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
useEffect(() => {
|
||||
document.title = t("titles.app");
|
||||
}, [t]);
|
||||
|
||||
return (
|
||||
<Layout className='tech-layout-container'>
|
||||
<TechSider />
|
||||
<Layout>
|
||||
<TechHeader />
|
||||
<Content className='tech-content-container'>
|
||||
<FcmNotification />
|
||||
<ErrorBoundary>
|
||||
<Suspense
|
||||
fallback={
|
||||
<LoadingSpinner message={t("general.labels.loadingapp")} />
|
||||
}>
|
||||
<TimeTicketModalContainer />
|
||||
<PrintCenterModalContainer />
|
||||
<Switch>
|
||||
<Route
|
||||
exact
|
||||
path={`${match.path}`}
|
||||
component={ManageRootPage}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path={`${match.path}/login`}
|
||||
component={TechLogin}
|
||||
/>
|
||||
</Switch>
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
|
||||
<BackTop />
|
||||
</Content>
|
||||
</Layout>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user