Skip to content

Commit

Permalink
Remove duplicated define functions
Browse files Browse the repository at this point in the history
  • Loading branch information
yasincaliskan committed Jan 12, 2024
1 parent 6eb42f6 commit 1234282
Show file tree
Hide file tree
Showing 4 changed files with 307 additions and 318 deletions.
48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.8",
"version": "1.0.9",
"name": "@perawallet/connect-beta",
"description": "Beta version of Pera Wallet Connect",
"main": "dist/index.js",
Expand All @@ -14,36 +14,36 @@
"author": "Pera Wallet",
"license": "ISC",
"devDependencies": {
"@hipo/eslint-config-base": "^4.1.1",
"@hipo/eslint-config-typescript": "^1.1.0",
"@rollup/plugin-image": "^2.1.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-replace": "^5.0.2",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.5.0",
"node-sass": "^8.0.0",
"prettier": "^2.6.1",
"rollup": "^2.70.1",
"rollup-plugin-eslint": "^7.0.0",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-sizes": "^1.0.5",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.31.2",
"sass": "^1.49.11",
"typescript": "^4.6.3"
"@hipo/eslint-config-base": "4.1.1",
"@hipo/eslint-config-typescript": "1.1.0",
"@rollup/plugin-image": "2.1.1",
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-replace": "5.0.2",
"@typescript-eslint/eslint-plugin": "6.18.1",
"@typescript-eslint/parser": "6.18.1",
"eslint": "8.12.0",
"eslint-config-prettier": "8.5.0",
"node-sass": "8.0.0",
"prettier": "2.6.1",
"rollup": "2.70.1",
"rollup-plugin-eslint": "7.0.0",
"rollup-plugin-postcss": "4.0.2",
"rollup-plugin-sizes": "1.0.5",
"rollup-plugin-terser": "7.0.2",
"rollup-plugin-typescript2": "0.31.2",
"sass": "1.49.11",
"typescript": "4.6.3"
},
"dependencies": {
"@evanhahn/lottie-web-light": "5.8.1",
"@walletconnect/client": "^1.8.0",
"@walletconnect/types": "^1.8.0",
"@walletconnect/client": "1.8.0",
"@walletconnect/types": "1.8.0",
"bowser": "2.11.0",
"buffer": "^6.0.3",
"buffer": "6.0.3",
"qr-code-styling": "1.6.0-rc.1"
},
"peerDependencies": {
"algosdk": "^2.1.0"
"algosdk": "2.1.0"
},
"types": "./dist/index.d.ts",
"repository": {
Expand Down
28 changes: 15 additions & 13 deletions src/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,27 @@ import {PeraWalletSignTxnModal} from "./modal/sign-txn/PeraWalletSignTxnModal";

import "./util/screen/setDynamicVhValue";

window.customElements.define("pera-wallet-connect-modal", PeraWalletConnectModal);
window.customElements.define(
"pera-wallet-modal-desktop-mode",
PeraWalletModalDesktopMode
);
window.customElements.define("pera-wallet-modal-header", PeraWalletModalHeader);
window.customElements.define(
function defineCustomElement(name: string, element: CustomElementConstructor) {
if (!window.customElements.get(name)) {
window.customElements.define(name, element);
}
}
defineCustomElement("pera-wallet-connect-modal", PeraWalletConnectModal);
defineCustomElement("pera-wallet-modal-desktop-mode", PeraWalletModalDesktopMode);
defineCustomElement("pera-wallet-modal-header", PeraWalletModalHeader);
defineCustomElement(
"pera-wallet-modal-touch-screen-mode",
PeraWalletModalTouchScreenMode
);
window.customElements.define("pera-wallet-redirect-modal", PeraWalletRedirectModal);
window.customElements.define(
defineCustomElement("pera-wallet-redirect-modal", PeraWalletRedirectModal);
defineCustomElement(
"pera-wallet-connect-modal-information-section",
PeraWalletConnectModalInformationSection
);
window.customElements.define(
defineCustomElement(
"pera-wallet-connect-modal-pending-message-section",
PeraWalletConnectModalPendingMessageSection
);
window.customElements.define("pera-wallet-sign-txn-toast", PeraWalletSignTxnToast);
window.customElements.define("pera-wallet-sign-txn-modal", PeraWalletSignTxnModal);
window.customElements.define("pera-wallet-download-qr-code", PeraWalletDownloadQRCode);
defineCustomElement("pera-wallet-sign-txn-toast", PeraWalletSignTxnToast);
defineCustomElement("pera-wallet-sign-txn-modal", PeraWalletSignTxnModal);
defineCustomElement("pera-wallet-download-qr-code", PeraWalletDownloadQRCode);
Loading

0 comments on commit 1234282

Please sign in to comment.