From ec1ee4eb0721ff82b327257c807bbb3a32089384 Mon Sep 17 00:00:00 2001 From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com> Date: Tue, 30 May 2023 19:13:59 +0200 Subject: [PATCH] replaced --- .../components/not-sponsored.src.js | 137 ------------------ 1 file changed, 137 deletions(-) delete mode 100644 plugins/plugins/core/become-minter/components/not-sponsored.src.js diff --git a/plugins/plugins/core/become-minter/components/not-sponsored.src.js b/plugins/plugins/core/become-minter/components/not-sponsored.src.js deleted file mode 100644 index c298b55c..00000000 --- a/plugins/plugins/core/become-minter/components/not-sponsored.src.js +++ /dev/null @@ -1,137 +0,0 @@ -import { LitElement, html } from 'lit'; -import { Epml } from '../../../../epml.js'; -import '../../components/ButtonIconCopy.js'; -import { use, translate, registerTranslateConfig } from 'lit-translate'; - -registerTranslateConfig({ - loader: (lang) => fetch(`/language/${lang}.json`).then((res) => res.json()), -}); - -import '@polymer/paper-spinner/paper-spinner-lite.js'; -import '@material/mwc-button'; -import '@material/mwc-textfield'; -import '@vaadin/button'; -import { pageStyles } from '../become-minter-css.src.js'; - -const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }); - -class NotSponsored extends LitElement { - static properties = { - atMount: { type: Function }, - isLoadingSponsorshipKeySubmit: { type: Boolean }, - sponsorshipKeyValue: { type: String }, - addMintingAccountMessage: { type: String }, - }; - - static styles = [pageStyles]; - - constructor() { - super(); - this.isLoadingSponsorshipKeySubmit = false; - this.sponsorshipKeyValue = ''; - this.addMintingAccountMessage = ''; - this.atMount = () => {}; - } - - renderErr1Text() { - return html`${translate('nodepage.nchange27')}`; - } - - renderErr2Text() { - return html`${translate('nodepage.nchange28')}`; - } - - getApiKey() { - const myNode = - window.parent.reduxStore.getState().app.nodeConfig.knownNodes[ - window.parent.reduxStore.getState().app.nodeConfig.node - ]; - let apiKey = myNode.apiKey; - return apiKey; - } - - addMintingAccount(e) { - this.isLoadingSponsorshipKeySubmit = true; - this.addMintingAccountMessage = 'Loading...'; - - parentEpml - .request('apiCall', { - url: `/admin/mintingaccounts?apiKey=${this.getApiKey()}`, - method: 'POST', - body: this.sponsorshipKeyValue, - }) - .then((res) => { - if (res === true) { - // refetch data - this.atMount(); - this.sponsorshipKeyValue = ''; - this.addMintingAccountMessage = this.renderErr1Text(); - this.isLoadingSponsorshipKeySubmit = false; - } else { - this.sponsorshipKeyValue = ''; - this.addMintingAccountMessage = this.renderErr2Text(); - this.isLoadingSponsorshipKeySubmit = false; - } - }); - } - - inputHandler(e) { - this.sponsorshipKeyValue = e.target.value; - } - - render() { - return html` -
-
-

- ${translate('mintingpage.mchange33')} -

-

- ${translate('mintingpage.mchange34')} -

-

- ${translate('mintingpage.mchange35')} -

-

- ${translate('mintingpage.mchange36')} -

-

- ${translate('mintingpage.mchange37')} -

- -

${this.addMintingAccountMessage}

-
-
- - -
- -
- - ${this.isLoadingSponsorshipKeySubmit === false - ? html`${translate('puzzlepage.pchange15')}` - : html` - - `} - -
-
-
-
- `; - } -} - -window.customElements.define('not-sponsored', NotSponsored);