Skip to content
Commits on Source (2)
...@@ -1980,11 +1980,6 @@ ...@@ -1980,11 +1980,6 @@
"integrity": "sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA==", "integrity": "sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA==",
"dev": true "dev": true
}, },
"@types/video.js": {
"version": "7.3.3",
"resolved": "https://registry.npmjs.org/@types/video.js/-/video.js-7.3.3.tgz",
"integrity": "sha512-yAb46+4A0dKFxOQRVLoLyfC/S/BmHLE10MxPXt/t88+7R4GWLHosHelVtYpKBRykjptdkqfQXNRXoQzDeKm6MA=="
},
"@types/webpack-sources": { "@types/webpack-sources": {
"version": "0.1.5", "version": "0.1.5",
"resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-0.1.5.tgz", "resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-0.1.5.tgz",
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
tokens. Next payout in tokens. Next payout in
<span>{{ nextPayout | timediff }}</span> (Daily at 2:00am UTC) <span>{{ nextPayout | timediff }}</span> (Daily at 2:00am UTC)
</div> </div>
<m-walletModal *ngIf="showModal" (closeModal)="showModal = false"> <m-walletModal [showModal]="showModal" (closeModal)="showModal = false">
<m-walletOnchainTransfer <m-walletOnchainTransfer
[offchainBalance]="offchainBalance.total" [offchainBalance]="offchainBalance.total"
[onchainAddress]="wallet.onchain.address" [onchainAddress]="wallet.onchain.address"
......
<div class="m-walletModal__backdrop"></div> <div *ngIf="_showModal" class="m-walletModal__container">
<div class="m-walletModal__close" (click)="clickedClose()"> <div class="m-walletModal__backdrop"></div>
<i class="material-icons">close</i> <div class="m-walletModal__close" (click)="close()">
</div> <i class="material-icons">close</i>
<div class="m-walletModal"> </div>
<div class="m-walletModal__content"> <div class="m-walletModal" (click)="clickedModal($event)">
<ng-content></ng-content> <div class="m-walletModal__content">
<ng-content></ng-content>
</div>
</div> </div>
</div> </div>
m-walletModal { m-walletModal {
display: block; .m-walletModal__container {
position: fixed; display: block;
top: 0; position: fixed;
bottom: 0; top: 0;
left: 0; bottom: 0;
right: 0; left: 0;
height: 100%; right: 0;
width: 100%; height: 100%;
overflow: scroll; width: 100%;
z-index: 9999999; overflow: scroll;
z-index: 9999999;
}
.m-walletModal__backdrop { .m-walletModal__backdrop {
position: fixed; position: fixed;
...@@ -82,8 +84,8 @@ m-walletModal { ...@@ -82,8 +84,8 @@ m-walletModal {
position: fixed; position: fixed;
height: 53px; height: 53px;
width: 53px; width: 53px;
right: 8px; right: 25px;
top: 8px; top: 25px;
padding: 4px; padding: 4px;
display: inline-block; display: inline-block;
border-radius: 50%; border-radius: 50%;
...@@ -92,7 +94,7 @@ m-walletModal { ...@@ -92,7 +94,7 @@ m-walletModal {
transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1); transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
@include m-theme() { @include m-theme() {
background-color: themed($m-white); background-color: themed($m-white);
box-shadow: 0 0 15px 0 rgba(themed($m-black), 0.2); box-shadow: 0 0 15px 0 rgba(themed($m-black), 0.25);
} }
i { i {
position: absolute; position: absolute;
......
import { import {
Component, Component,
Output, Output,
Input,
EventEmitter, EventEmitter,
AfterViewInit,
OnDestroy, OnDestroy,
HostListener,
} from '@angular/core'; } from '@angular/core';
@Component({ @Component({
selector: 'm-walletModal', selector: 'm-walletModal',
templateUrl: './modal.component.html', templateUrl: './modal.component.html',
}) })
export class WalletModalComponent implements AfterViewInit, OnDestroy { export class WalletModalComponent implements OnDestroy {
showModalTimeout: any = null;
justOpened = true;
public _showModal = false;
@Input()
public set showModal(val: boolean) {
this._showModal = val;
if (val) {
this.show();
}
}
@Output() closeModal: EventEmitter<any> = new EventEmitter(); @Output() closeModal: EventEmitter<any> = new EventEmitter();
// root;
constructor() {} constructor() {}
ngAfterViewInit() { show() {
if (document && document.body) { if (document && document.body) {
this.justOpened = true;
document.body.classList.add('m-overlay-modal--shown--no-scroll'); document.body.classList.add('m-overlay-modal--shown--no-scroll');
// Prevent dismissal of modal when it's just been opened
this.showModalTimeout = setTimeout(() => {
this.justOpened = false;
}, 20);
} }
}
// if (!this.root && document && document.body) { // * MODAL DISMISSAL * --------------------------------------------------------------------------
// this.root = document.body; // Dismiss modal when backdrop is clicked and modal is open
// } @HostListener('document:click', ['$event'])
// if (this.root) { clickedBackdrop($event) {
// this.root.classList.add('m-overlay-modal--shown'); if (this._showModal && !this.justOpened) {
// // document.body.classList.add('m-overlay-modal--shown--no-scroll'); $event.preventDefault();
// } $event.stopPropagation();
this.close();
}
} }
ngOnDestroy() {
document.body.classList.remove('m-overlay-modal--shown--no-scroll'); // Don't dismiss modal if click somewhere other than backdrop
clickedModal($event) {
$event.stopPropagation();
} }
clickedClose() { close() {
document.body.classList.remove('m-overlay-modal--shown--no-scroll'); document.body.classList.remove('m-overlay-modal--shown--no-scroll');
// if (this.root) {
// this.root.classList.remove('m-overlay-modal--shown');
// document.body.classList.remove('m-overlay-modal--shown--no-scroll');
// }
this.closeModal.emit(); this.closeModal.emit();
} }
ngOnDestroy() {
if (this.showModalTimeout) {
clearTimeout(this.showModalTimeout);
}
this.close();
}
} }
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</div> </div>
</div> </div>
</div> </div>
<m-walletModal *ngIf="showModal" (closeModal)="showModal = false"> <m-walletModal [showModal]="showModal" (closeModal)="showModal = false">
<m-walletPhoneVerification <m-walletPhoneVerification
class="m-walletTokenOnboardingModal__view--verifyPhone" class="m-walletTokenOnboardingModal__view--verifyPhone"
*ngIf="activeStep === 'phone'" *ngIf="activeStep === 'phone'"
......