Web: Added Payments Routing.

This commit is contained in:
TatianaLopaeva 2021-01-29 17:39:26 +03:00
parent 652c7bd906
commit cf65b86b22
6 changed files with 22 additions and 11 deletions

View File

@ -1,6 +1,6 @@
import React, { useEffect } from "react";
import { connect } from "react-redux";
import { Router, Switch } from "react-router-dom";
import { Router, Switch, Link } from "react-router-dom";
import NavMenu from "@appserver/common/src/components/NavMenu";
import Main from "@appserver/common/src/components/Main";
import Box from "@appserver/components/src/components/box";
@ -20,6 +20,7 @@ import {
} from "@appserver/common/src/store/auth/actions";
import { updateTempContent } from "@appserver/common/src/utils";
const Payments = React.lazy(() => import("./components/pages/Payments"));
const Error404 = React.lazy(() =>
import("@appserver/common/src/pages/errors/404")
);
@ -29,6 +30,14 @@ const People = React.lazy(() => import("people/page"));
const Files = React.lazy(() => import("files/page"));
const About = React.lazy(() => import("./components/pages/About"));
const PaymentsRoute = (props) => (
<React.Suspense fallback={null}>
<ErrorBoundary>
<Payments {...props} />
</ErrorBoundary>
</React.Suspense>
);
const Error404Route = (props) => (
<React.Suspense fallback={null}>
<ErrorBoundary>
@ -142,6 +151,7 @@ const Shell = ({ items = [], page = "home", ...rest }) => {
]}
component={LoginRoute}
/>
<PrivateRoute path="/payments" component={PaymentsRoute} />
<PrivateRoute component={Error404Route} />
</Switch>
</Main>

View File

@ -5,7 +5,7 @@ import { connect } from "react-redux";
import { withTranslation } from "react-i18next";
import PropTypes from "prop-types";
import PageLayout from "@appserver/common/src/components/PageLayout";
import utils from "@appserver/common/src/utils";
import {changeLanguage }from "@appserver/common/src/utils";
import store from "@appserver/common/src/store";
import Loader from "@appserver/components/src/components/loader";
import { tablet, size } from "@appserver/components/src/utils/device";
@ -21,7 +21,7 @@ const i18n = createI18N({
localesPath: "pages/PaymentsEnterprise",
});
const { setCurrentProductId } = store.auth.actions;
const { changeLanguage } = utils;
const StyledBody = styled.div`
margin: 0 auto;

View File

@ -1,13 +1,13 @@
import React, { useEffect } from "react";
import { connect } from "react-redux";
import styled from "styled-components";
import utils from "@appserver/common/src/utils";
import {changeLanguage} from "@appserver/common/src/utils";
import Text from "@appserver/components/src/components/text";
import Box from "@appserver/components/src/components/box";
import { tablet } from "@appserver/components/src/utils/device";
import { createI18N } from "../../../../helpers/i18n";
import { useTranslation, Trans } from "react-i18next";
const { changeLanguage } = utils;
const i18n = createI18N({
page: "PaymentsEnterprise",

View File

@ -7,9 +7,9 @@ import { createI18N } from "../../../../helpers/i18n";
import Button from "@appserver/components/src/components/button";
import { tablet } from "@appserver/components/src/utils/device";
import toastr from "@appserver/components/src/components/toast/toastr";
import utils from "@appserver/common/src/utils";
import {changeLanguage }from "@appserver/common/src/utils";
import { setPaymentsLicense } from "../../../../store/payments/actions";
const { changeLanguage } = utils;
const i18n = createI18N({
page: "PaymentsEnterprise",

View File

@ -5,11 +5,11 @@ import { connect } from "react-redux";
import { withRouter } from "react-router";
import { useTranslation } from "react-i18next";
import { createI18N } from "../../../../helpers/i18n";
import utils from "@appserver/common/src/utils";
import {changeLanguage} from "@appserver/common/src/utils";
import Text from "@appserver/components/src/components/text";
import Link from "@appserver/components/src/components/link";
const { changeLanguage } = utils;
const i18n = createI18N({
page: "PaymentsEnterprise",

View File

@ -4,12 +4,13 @@ import styled from "styled-components";
import { connect } from "react-redux";
import { withRouter } from "react-router";
import Text from "@appserver/components/src/components/text";
import utils from "@appserver/common/src/utils";
import {changeLanguage} from "@appserver/common/src/utils";
import { useTranslation, Trans } from "react-i18next";
import { createI18N } from "../../../../helpers/i18n";
import moment from "moment";
const { changeLanguage } = utils;
const i18n = createI18N({
page: "PaymentsEnterprise",