diff --git a/src/core/providers/helpers/ledger/components/LedgerModalComponent/LedgerModalComponent.ts b/src/core/providers/helpers/ledger/components/LedgerConnectModal/LedgerModalComponent.ts similarity index 72% rename from src/core/providers/helpers/ledger/components/LedgerModalComponent/LedgerModalComponent.ts rename to src/core/providers/helpers/ledger/components/LedgerConnectModal/LedgerModalComponent.ts index 6953a10..e51164f 100644 --- a/src/core/providers/helpers/ledger/components/LedgerModalComponent/LedgerModalComponent.ts +++ b/src/core/providers/helpers/ledger/components/LedgerConnectModal/LedgerModalComponent.ts @@ -1,49 +1,24 @@ import { LitElement, html } from 'lit'; import { customElement, property } from 'lit/decorators.js'; -import { ledgerStyles } from './ldegerModalComponent.styles'; -import { ILedgerAccount } from '../../ledger.types'; +import { ledgerStyles } from './ledgerConnectModal.styles'; import { EventBus } from '../EventBus'; import { renderAccounts } from './components/renderAccounts'; import { renderInModal } from './components/renderInModal'; - -export interface IConnectScreenData { - customContentMarkup?: string; - disabled?: boolean; - error?: string; -} - -export interface IAccountScreenData { - accounts: ILedgerAccount[]; - startIndex: number; - addressesPerPage: number; - isLoading: boolean; -} - -export interface IConfirmScreenData { - data?: string; - selectedAddress: string; - confirmAddressText?: string; - authText?: string; - areShownText?: string | null; -} - -export interface ILedgerModalData { - connectScreenData: IConnectScreenData | null; - accountScreenData: IAccountScreenData | null; - shouldClose?: true; - confirmScreenData: IConfirmScreenData | null; -} +import { + ILedgerConnectModalData, + LedgerConnectEventsEnum +} from './ledgerConnectModal.types'; @customElement('ledger-connect-modal') -export class LedgerModalComponent extends LitElement { - @property({ type: Object }) public data: ILedgerModalData = { +export class LedgerConnectModal extends LitElement { + @property({ type: Object }) public data: ILedgerConnectModalData = { accountScreenData: null, confirmScreenData: null, connectScreenData: {} }; @property({ type: Number }) private selectedIndex = 0; - @property({ type: Number }) private selectedAddress = ''; + @property({ type: String }) private selectedAddress = ''; static styles = ledgerStyles; @@ -99,25 +74,33 @@ export class LedgerModalComponent extends LitElement { }); } - // TODO: test simple ledger connection without token if (confirmScreenData) { return renderInModal({ onClose: () => this.close(), title: html`Confirm`, subtitle: html`Confirm Ledger Address`, - body: html`