Skip to content

Commit 18f39af

Browse files
authored
Merge pull request #1713 from shadow-dot-cat/castaway/stripe_dialog_scroll
fix(stripe): Allow dialog to scroll (make Submit reachable)
2 parents 2440ea7 + db8ccde commit 18f39af

6 files changed

+25
-21
lines changed

src/app/account-app/account-app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/lega
5858
import { MatLegacyCardModule as MatCardModule } from '@angular/material/legacy-card';
5959
import { MatLegacyCheckboxModule as MatCheckboxModule } from '@angular/material/legacy-checkbox';
6060
import { MatDatepickerModule } from '@angular/material/datepicker';
61-
import { MatLegacyDialogModule as MatDialogModule } from '@angular/material/legacy-dialog';
61+
import { MatDialogModule as MatDialogModule } from '@angular/material/dialog';
6262
import { MatExpansionModule } from '@angular/material/expansion';
6363
import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
6464
import { MatIconModule } from '@angular/material/icon';

src/app/account-app/bitpay-payment-dialog.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// ---------- END RUNBOX LICENSE ----------
1919

2020
import { Component, Inject } from '@angular/core';
21-
import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog';
21+
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
2222
import { Router } from '@angular/router';
2323

2424
import { CartService } from './cart.service';

src/app/account-app/paypal-payment-dialog.component.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,33 @@
1818
// ---------- END RUNBOX LICENSE ----------
1919

2020
import { Component, Inject } from '@angular/core';
21-
import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog';
21+
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
2222

2323
import { RunboxWebmailAPI } from '../rmmapi/rbwebmail';
2424

2525
@Component({
2626
selector: 'app-paypal-payment-dialog-component',
2727
template: `
28-
<div mat-dialog-content style="width: 500px; height: 300px;">
29-
<h1 mat-dialog-title>PayPal payment</h1>
30-
<div *ngIf="!redirect_url">
31-
<div> We're preparing your Paypal payment, please wait...</div>
32-
<mat-spinner style="margin:0 auto;"></mat-spinner>
33-
</div>
34-
<div *ngIf="redirect_url">
35-
Your PayPal payment link is ready. Please click the button below to be transferred to PayPal and complete your payment.
36-
</div>
37-
<br /><br />
38-
<div style="text-align: center">
39-
<a *ngIf="redirect_url" mat-flat-button color="primary" [href]="redirect_url" style="background: none">
28+
<h1 mat-dialog-title>PayPal payment</h1>
29+
<div mat-dialog-content>
30+
<div *ngIf="!redirect_url">
31+
<div> We're preparing your Paypal payment, please wait...</div>
32+
<mat-spinner style="margin:0 auto;"></mat-spinner>
33+
</div>
34+
<div *ngIf="redirect_url">
35+
Your PayPal payment link is ready. Please click the button below to be transferred to PayPal and complete your payment.
36+
</div>
37+
<br /><br />
38+
<div style="text-align: center">
39+
<a *ngIf="redirect_url" mat-flat-button color="primary" [href]="redirect_url" style="background: none">
4040
<img src="/_img/pay/paypal_bundle_s.png" alt="PayPal">
41-
</a>
41+
</a>
42+
</div>
4243
</div>
4344
<div mat-dialog-actions style="justify-content: space-between;">
4445
<button mat-button (click)="close()"> Cancel </button>
4546
<a *ngIf="redirect_url" mat-flat-button color="primary" [href]="redirect_url"> Continue to PayPal </a>
4647
</div>
47-
</div>
4848
`
4949
})
5050
export class PaypalPaymentDialogComponent {

src/app/account-app/shopping-cart.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// ---------- END RUNBOX LICENSE ----------
1919

2020
import { Component, OnInit } from '@angular/core';
21-
import { MatLegacyDialog as MatDialog, MatLegacyDialogRef as MatDialogRef } from '@angular/material/legacy-dialog';
21+
import { MatDialog as MatDialog, MatDialogRef as MatDialogRef } from '@angular/material/dialog';
2222
import { ActivatedRoute, Router } from '@angular/router';
2323
import { Subject } from 'rxjs';
2424

@@ -236,6 +236,7 @@ export class ShoppingCartComponent implements OnInit {
236236
let dialogRef: MatDialogRef<any>;
237237
if (method === 'stripe') {
238238
dialogRef = this.dialog.open(StripePaymentDialogComponent, {
239+
'height': '90%',
239240
data: { tx }
240241
});
241242
} else if (method === 'coinbase') {
@@ -244,6 +245,8 @@ export class ShoppingCartComponent implements OnInit {
244245
});
245246
} else if (method === 'paypal') {
246247
dialogRef = this.dialog.open(PaypalPaymentDialogComponent, {
248+
'height': '300px',
249+
'width': '500px',
247250
data: { tx }
248251
});
249252
} else if (method === 'giro') {

src/app/account-app/stripe-payment-dialog.component.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<h1 mat-dialog-title>Card payment</h1>
2+
<div mat-dialog-content>
23
<div [style.display]="state === 'initial' ? 'block' : 'none'">
3-
<div >
4+
<div>
45
<div #paymentElement id="payment-element"></div>
56
</div>
67

@@ -28,7 +29,7 @@ <h1 mat-dialog-title>Card payment</h1>
2829
</div>
2930

3031
<div class="description" style="text-align: center"> Payment form not working? <a href="/payment/payment?tid={{tid}}&method=stripe" target="_blank">Try our alternative payment system instead.</a> </div>
31-
32+
</div>
3233
<div mat-dialog-actions style="justify-content: center;" *ngIf="state === 'loading'">
3334
<button mat-button (click)="close()"> Cancel </button>
3435
</div>

src/app/account-app/stripe-payment-dialog.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import { AfterViewInit, Component, ElementRef, Inject, ViewChild } from '@angular/core';
2121
import { Router } from '@angular/router';
22-
import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/legacy-dialog';
22+
import { MatDialogRef as MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
2323
import { HttpErrorResponse } from '@angular/common/http';
2424

2525
import { PaymentsService } from './payments.service';

0 commit comments

Comments
 (0)