From 23666db4615b5038cf7b263b0b3f98026971381d Mon Sep 17 00:00:00 2001 From: TatianaLopaeva Date: Sun, 6 Sep 2020 12:49:37 +0300 Subject: [PATCH 1/4] Changed style for buttons, added logic for loading file when clicking a file, hidden FileInput --- .../pages/PaymentsEnterprise/index.js | 4 +- .../sub-components/button-container.js | 90 +++++++++---------- .../sub-components/header-container.js | 8 +- 3 files changed, 49 insertions(+), 53 deletions(-) diff --git a/web/ASC.Web.Client/src/components/pages/PaymentsEnterprise/index.js b/web/ASC.Web.Client/src/components/pages/PaymentsEnterprise/index.js index 2817bc8b34..095ae9035c 100644 --- a/web/ASC.Web.Client/src/components/pages/PaymentsEnterprise/index.js +++ b/web/ASC.Web.Client/src/components/pages/PaymentsEnterprise/index.js @@ -41,6 +41,7 @@ class Body extends React.PureComponent { constructor(props) { super(props); const { t } = this.props; + this.state = { errorMessage: null, isErrorLicense: false, @@ -62,12 +63,13 @@ class Body extends React.PureComponent { onButtonClickUpload = (file) => { const { setLicense, t } = this.props; + let fd = new FormData(); fd.append("files", file); setLicense(null, fd) .then(() => { - toastr.success(t("LoadingLicenseSuccess"), "", 0, true); + toastr.success(t("LoadingLicenseSuccess"), "", 5000, true); }) .catch((error) => { toastr.error(t("LoadingLicenseError"), t("LicenseIsNotValid"), 0, true); diff --git a/web/ASC.Web.Client/src/components/pages/PaymentsEnterprise/sub-components/button-container.js b/web/ASC.Web.Client/src/components/pages/PaymentsEnterprise/sub-components/button-container.js index fbe171ed80..b71041d47b 100644 --- a/web/ASC.Web.Client/src/components/pages/PaymentsEnterprise/sub-components/button-container.js +++ b/web/ASC.Web.Client/src/components/pages/PaymentsEnterprise/sub-components/button-container.js @@ -10,35 +10,29 @@ const StyledButtonContainer = styled.div` background: #edf2f7; height: 108px; margin-bottom: 17px; - position: relative; + display: flex; .button-payments-enterprise { border-radius: 3px; - padding: 13px 20px; - padding: 0px; + padding: 12px 20px; + display: inline-block; background: #2da7db; color: white; - height: 44px; + height: 45px; font-weight: 600; font-size: 16px; line-height: 20px; } .button-buy { - width: 107px; - margin: 32px 16px 32px 32px; + /* width: 107px; */ + margin: 32px 14px 32px 32px; } + .button-upload { - width: 153px; - margin: 32px 612px 32px 0px; + /* width: 153px; */ + margin: 32px 0px 32px 0px; + /* z-index: 8; */ } - .input { - position: absolute; - - left: 155px; /*width of button-buy and margin*/ - bottom: 0px; - opacity: 0; - z-index: 1; - } @media ${tablet} { width: 600px; height: 168px; @@ -72,35 +66,41 @@ const StyledButtonContainer = styled.div` } `; -const ButtonContainer = ({ - t, - buyUrl, - onButtonClickBuy, - onButtonClickUpload, -}) => { - return ( - -