IO-1551 Refactor messaging.
This commit is contained in:
@@ -5,13 +5,12 @@ import preval from "preval.macro";
|
||||
import React, { lazy, Suspense, useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import ErrorBoundary from "../../components/error-boundary/error-boundary.component";
|
||||
import { Link, Route, Switch } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import BreadCrumbs from "../../components/breadcrumbs/breadcrumbs.component";
|
||||
import ChatAffixContainer from "../../components/chat-affix/chat-affix.container";
|
||||
import ConflictComponent from "../../components/conflict/conflict.component";
|
||||
import FcmNotification from "../../components/fcm-notification/fcm-notification.component";
|
||||
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";
|
||||
@@ -20,12 +19,11 @@ import PartnerPingComponent from "../../components/partner-ping/partner-ping.com
|
||||
import PrintCenterModalContainer from "../../components/print-center-modal/print-center-modal.container";
|
||||
import ShopSubStatusComponent from "../../components/shop-sub-status/shop-sub-status.component";
|
||||
import TestComponent from "../../components/_test/test.component";
|
||||
import { QUERY_STRIPE_ID } from "../../graphql/bodyshop.queries";
|
||||
import { requestForToken } from "../../firebase/firebase.utils";
|
||||
import {
|
||||
selectBodyshop,
|
||||
selectInstanceConflict,
|
||||
} from "../../redux/user/user.selectors";
|
||||
import client from "../../utils/GraphQLClient";
|
||||
import "./manage.page.styles.scss";
|
||||
|
||||
const ManageRootPage = lazy(() =>
|
||||
@@ -166,16 +164,15 @@ const Dms = lazy(() => import("../dms/dms.container"));
|
||||
const { Content, Footer } = Layout;
|
||||
|
||||
const stripePromise = new Promise((resolve, reject) => {
|
||||
client.query({ query: QUERY_STRIPE_ID }).then((resp) => {
|
||||
if (resp.data.bodyshops[0])
|
||||
resolve(
|
||||
loadStripe(process.env.REACT_APP_STRIPE_PUBLIC_KEY, {
|
||||
stripeAccount:
|
||||
resp.data.bodyshops[0].stripe_acct_id || "No Stripe Id Resolve",
|
||||
})
|
||||
);
|
||||
reject();
|
||||
});
|
||||
// client.query({ query: QUERY_STRIPE_ID }).then((resp) => {
|
||||
// if (resp.data.bodyshops[0])
|
||||
resolve(
|
||||
loadStripe(process.env.REACT_APP_STRIPE_PUBLIC_KEY, {
|
||||
stripeAccount: "No Stripe Id Resolve",
|
||||
})
|
||||
);
|
||||
// reject();
|
||||
// });
|
||||
});
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
@@ -188,7 +185,9 @@ export function Manage({ match, conflict, bodyshop }) {
|
||||
useEffect(() => {
|
||||
const widgetId = "IABVNO4scRKY11XBQkNr";
|
||||
window.noticeable.render("widget", widgetId);
|
||||
requestForToken();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
document.title = t("titles.app");
|
||||
}, [t]);
|
||||
@@ -395,7 +394,6 @@ export function Manage({ match, conflict, bodyshop }) {
|
||||
<HeaderContainer />
|
||||
|
||||
<Content className="content-container">
|
||||
<FcmNotification />
|
||||
<PartnerPingComponent />
|
||||
<ErrorBoundary>{PageContent}</ErrorBoundary>
|
||||
<BackTop />
|
||||
|
||||
@@ -5,7 +5,7 @@ import { connect } from "react-redux";
|
||||
import { Redirect, Route, Switch } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
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";
|
||||
@@ -58,7 +58,6 @@ export function TechPage({ technician, match }) {
|
||||
{technician ? null : <Redirect to={`${match.path}/login`} />}
|
||||
<TechHeader />
|
||||
<Content className="tech-content-container">
|
||||
<FcmNotification />
|
||||
<ErrorBoundary>
|
||||
<Suspense
|
||||
fallback={
|
||||
|
||||
Reference in New Issue
Block a user