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)