From 4e171f4f82317cb7e46fb6510a941281b9395391 Mon Sep 17 00:00:00 2001 From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com> Date: Wed, 23 Mar 2022 11:29:03 -0700 Subject: [PATCH] Nerw Electron --- .../src/components/logout-view/logout-view.js | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 qortal-ui-core/src/components/logout-view/logout-view.js diff --git a/qortal-ui-core/src/components/logout-view/logout-view.js b/qortal-ui-core/src/components/logout-view/logout-view.js new file mode 100644 index 00000000..a8f8a636 --- /dev/null +++ b/qortal-ui-core/src/components/logout-view/logout-view.js @@ -0,0 +1,70 @@ +import { LitElement, html, css } from 'lit' +import { connect } from 'pwa-helpers' +import { store } from '../../store.js' + +import '@polymer/paper-dialog/paper-dialog.js' +import '@material/mwc-button' + +import { doLogout } from '../../redux/app/app-actions.js' + +class LogoutView extends connect(store)(LitElement) { + static get properties() { + return { + } + } + + static get styles() { + return css` + * { + --mdc-theme-primary: rgb(3, 169, 244); + --mdc-theme-secondary: var(--mdc-theme-primary); + --mdc-theme-surface: var(--white); + --mdc-dialog-content-ink-color: var(--black); + } + + .decline { + --mdc-theme-primary: var(--mdc-theme-error) + } + + .buttons { + text-align:right; + } + ` + } + + constructor() { + super() + } + + render() { + return html` + +
+

Qortal UI

+
+
+
+

Are you sure you want to logout?

+
+
+ this.decline(e)} dialog-dismiss>NO + this.confirm(e)} dialog-confirm autofocus>YES +
+
+ ` + } + + openLogout() { + this.shadowRoot.getElementById('userLogoutDialog').open() + } + + async confirm(e) { + store.dispatch(doLogout()) + } + + decline(e) { + this.shadowRoot.getElementById('userLogoutDialog').close() + } +} + +window.customElements.define('logout-view', LogoutView)