Rename at index and modal-dialog-container
This commit is contained in:
parent
9bac1c0639
commit
6816ebc6cb
@ -13,9 +13,7 @@ import ContactContainer from "./sub-components/contact-container";
|
||||
import ModalDialogContainer from "./sub-components/modal-dialog-container";
|
||||
import { setLicense } from "../../../store/payments/actions";
|
||||
import { createI18N } from "../../../helpers/i18n";
|
||||
import moment from "moment";
|
||||
|
||||
import isEmpty from "lodash/isEmpty";
|
||||
const i18n = createI18N({
|
||||
page: "PaymentsEnterprise",
|
||||
localesPath: "pages/PaymentsEnterprise",
|
||||
@ -43,10 +41,9 @@ class Body extends React.PureComponent {
|
||||
super(props);
|
||||
const { t } = this.props;
|
||||
this.state = {
|
||||
errorMessage: null,
|
||||
license: false,
|
||||
hasErrorLicense: false,
|
||||
visibleModalDialog: false,
|
||||
// errorMessage: null,
|
||||
// isErrorLicense: false,
|
||||
isVisible: false,
|
||||
};
|
||||
|
||||
document.title = `${t("Payments")} – ${t("OrganizationName")}`;
|
||||
@ -70,9 +67,9 @@ class Body extends React.PureComponent {
|
||||
|
||||
setLicense(null, fd).catch((e) =>
|
||||
this.setState({
|
||||
errorMessage: e,
|
||||
hasErrorLicense: true,
|
||||
visibleModalDialog: true,
|
||||
// errorMessage: e,
|
||||
// isErrorLicense: true,
|
||||
isVisible: true,
|
||||
})
|
||||
);
|
||||
};
|
||||
@ -81,8 +78,8 @@ class Body extends React.PureComponent {
|
||||
};
|
||||
onCloseModalDialog = () => {
|
||||
this.setState({
|
||||
visibleModalDialog: false,
|
||||
errorMessage: null,
|
||||
isVisible: false,
|
||||
// errorMessage: null,
|
||||
});
|
||||
};
|
||||
render() {
|
||||
@ -95,7 +92,7 @@ class Body extends React.PureComponent {
|
||||
t,
|
||||
createPortals,
|
||||
} = this.props;
|
||||
const { hasErrorLicense, errorMessage, visibleModalDialog } = this.state;
|
||||
const { isVisible } = this.state;
|
||||
return !isLoaded ? (
|
||||
<Loader className="pageLoader" type="rombs" size="40px" />
|
||||
) : (
|
||||
@ -108,14 +105,12 @@ class Body extends React.PureComponent {
|
||||
<AdvantagesContainer t={t} />
|
||||
<ModalDialogContainer
|
||||
t={t}
|
||||
visibleModalDialog={visibleModalDialog}
|
||||
errorMessage={errorMessage}
|
||||
isVisible={isVisible}
|
||||
onCloseModalDialog={this.onCloseModalDialog}
|
||||
/>
|
||||
<ButtonContainer
|
||||
t={t}
|
||||
buyUrl={buyUrl}
|
||||
hasErrorLicense={hasErrorLicense}
|
||||
onButtonClickBuy={this.onButtonClickBuy}
|
||||
onButtonClickUpload={this.onButtonClickUpload}
|
||||
/>
|
||||
|
@ -27,17 +27,13 @@ const StyledHeader = styled.div`
|
||||
margin-bottom: 17px;
|
||||
}
|
||||
`;
|
||||
const ModalDialogContainer = ({
|
||||
t,
|
||||
visibleModalDialog,
|
||||
onCloseModalDialog,
|
||||
}) => {
|
||||
const ModalDialogContainer = ({ t, isVisible, onCloseModalDialog }) => {
|
||||
const header = <StyledHeader>{t("LoadingError")}</StyledHeader>;
|
||||
const body = <StyledBody>{t("LicenseError")}</StyledBody>;
|
||||
return (
|
||||
<ModalDialog
|
||||
bodyPadding="0px"
|
||||
visible={visibleModalDialog}
|
||||
visible={isVisible}
|
||||
displayType="auto"
|
||||
zIndex={310}
|
||||
headerContent={header}
|
||||
|
Loading…
Reference in New Issue
Block a user