Added status changing information
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
import { BackTop, Layout } from "antd";
|
||||
import { BackTop, Layout, notification } from "antd";
|
||||
import React, { lazy, Suspense, useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
//This page will handle all routing for the entire application.
|
||||
import { connect } from "react-redux";
|
||||
import { Route } from "react-router";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { useQuery } from "react-apollo";
|
||||
import { QUERY_BODYSHOP } from "../../graphql/bodyshop.queries";
|
||||
import ErrorBoundary from "../../components/error-boundary/error-boundary.component";
|
||||
import FooterComponent from "../../components/footer/footer.component";
|
||||
//Component Imports
|
||||
import HeaderContainer from "../../components/header/header.container";
|
||||
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
|
||||
//const WhiteBoardPage = lazy(() => import("../white-board/white-board.page"));
|
||||
import { setBodyshop } from "../../redux/user/user.actions";
|
||||
import "./manage.page.styles.scss";
|
||||
|
||||
//const WhiteBoardPage = lazy(() => import("../white-board/white-board.page"));
|
||||
const ManageRootPage = lazy(() =>
|
||||
import("../manage-root/manage-root.page.container")
|
||||
);
|
||||
@@ -32,10 +38,27 @@ const ScheduleContainer = lazy(() =>
|
||||
);
|
||||
|
||||
const { Header, Content, Footer } = Layout;
|
||||
//This page will handle all routing for the entire application.
|
||||
export default function Manage({ match }) {
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
setBodyshop: bs => dispatch(setBodyshop(bs))
|
||||
});
|
||||
export default connect(
|
||||
null,
|
||||
mapDispatchToProps
|
||||
)(function Manage({ match, setBodyshop }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { error, data } = useQuery(QUERY_BODYSHOP, {
|
||||
fetchPolicy: "network-only"
|
||||
});
|
||||
|
||||
if (error) {
|
||||
notification["error"]({ message: t("bodyshop.errors.loading") });
|
||||
}
|
||||
if (data) {
|
||||
setBodyshop(data.bodyshops[0]);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
document.title = t("titles.app");
|
||||
}, [t]);
|
||||
@@ -96,4 +119,4 @@ export default function Manage({ match }) {
|
||||
<BackTop />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user