import { generateDeflyWalletConnectDeepLink } from "../../../util/deflyWalletUtils"; import styles from "./_defly-wallet-modal-touch-screen-mode.scss"; const deflyWalletModalTouchScreenMode = document.createElement("template"); const touchScreenDefaultMode = `
Launch Defly Wallet

New to Defly Wallet?

Install Defly Wallet
`; export class DeflyWalletModalTouchScreenMode extends HTMLElement { constructor() { super(); this.attachShadow({mode: "open"}); deflyWalletModalTouchScreenMode.innerHTML = touchScreenDefaultMode; if (this.shadowRoot) { const styleSheet = document.createElement("style"); styleSheet.textContent = styles; this.shadowRoot.append( deflyWalletModalTouchScreenMode.content.cloneNode(true), styleSheet ); const launchDeflyLink = this.shadowRoot?.getElementById( "defly-wallet-connect-modal-touch-screen-mode-launch-defly-wallet-button" ); const URI = this.getAttribute("uri"); if (launchDeflyLink && URI) { launchDeflyLink.setAttribute("href", generateDeflyWalletConnectDeepLink(URI)); launchDeflyLink.addEventListener("click", () => { this.onClickLaunch(); }); } } } onClickLaunch() { deflyWalletModalTouchScreenMode.innerHTML = `
`; if (this.shadowRoot) { const styleSheet = document.createElement("style"); styleSheet.textContent = styles; this.shadowRoot.innerHTML = ""; this.shadowRoot.append( deflyWalletModalTouchScreenMode.content.cloneNode(true), styleSheet ); } } }