Skip to content

Commit

Permalink
Temporary Canada bank-not-supported message
Browse files Browse the repository at this point in the history
Rolled back Node version to one supported by Cloudflare.
  • Loading branch information
jonahbron committed Jan 21, 2023
1 parent 493b7ed commit eb6ad2a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.4.0
16.19.0
7 changes: 7 additions & 0 deletions frontend/src/element/signup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ button {
font-size: 20px;
}

button[disabled] {
border-color: constants.$gray-80;
color: constants.$gray-80;
opacity: 0.7;
cursor: default;
}

.invalidatable {
input:invalid,
select:invalid {
Expand Down
26 changes: 25 additions & 1 deletion frontend/src/element/signup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ export class Signup extends LitElement {

cardElement: StripeCardElement;

// TODO(#208): Temporary until bank accounts are supported for Canada.
@state()
protected bankSupported = true;

@state()
protected paymentMethod: 'bank' | 'card' | 'plaid' = 'plaid';

Expand Down Expand Up @@ -329,15 +333,28 @@ export class Signup extends LitElement {

private paymentTemplate(): TemplateResult {
return html` <h2>Payment</h2>
${this.bankSupported
? ''
: html` <div class="field full-width">
<div class="title">
Currently only card payment is supported in Canada. Please email
<a href="mailto:[email protected]">
[email protected]</a
>
after you've completed sign-up and we can manually switch you over
to bank payment if you prefer.
</div>
</div>`}
<div class="payment-method-toggle full-width">
<button
?disabled=${!this.bankSupported}
class=${classMap({ selected: this.isMethod('plaid') })}
@click=${this.setMethod('plaid')}
>
Bank account
</button>
<button
?disabled=${!this.bankSupported}
class=${classMap({ selected: this.isMethod('bank') })}
@click=${this.setMethod('bank')}
>
Expand Down Expand Up @@ -1163,6 +1180,13 @@ export class Signup extends LitElement {
if (this.billingCountry != null) {
this.billingCountry.value = this.mailingCountry.value;
}
// TODO(#208): Temporary until bank accounts are supported for Canada.
if (this.mailingCountry.value === 'Canada') {
this.paymentMethod = 'card';
this.bankSupported = false;
} else {
this.bankSupported = true;
}
this.requestUpdate();
}

Expand Down

0 comments on commit eb6ad2a

Please sign in to comment.