Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds error handling for Bitcoin.com widget #6823

Merged
merged 1 commit into from
Oct 10, 2020
Merged

Adds error handling for Bitcoin.com widget #6823

merged 1 commit into from
Oct 10, 2020

Conversation

ryanml
Copy link
Contributor

@ryanml ryanml commented Oct 9, 2020

Fixes brave/brave-browser#11960

Screen Shot 2020-10-08 at 5 43 05 PM

Submitter Checklist:

Test Plan:

Defined in issue

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@ryanml ryanml added this to the 1.17.x - Nightly milestone Oct 9, 2020
@ryanml ryanml requested review from AlanBreck and emerick October 9, 2020 01:23
@ryanml ryanml self-assigned this Oct 9, 2020
Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

return (
<Styled.FooterWrapper>
<Styled.BuyButton onClick={this.openBuyURL}>
<Styled.BuyButton
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: disabled if there is an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -226,7 +249,7 @@ export const BuyButton = styled<{}, 'button'>('button')`
padding: 12px 0px;
font-weight: bold;
font-size: 13px;
cursor: pointer;
cursor: ${p => p.error ? 'default' : 'pointer'};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: disabled style

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -18,6 +18,7 @@ interface State {
currentAmount: string
assetsShowing: boolean
fiatCurrenciesShowing: boolean
amountError: boolean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if this were a string then you could support multiple types of error (null would mean no error), but I guess here there is only 1 invalid amount error case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct yeah, this is the only path to user error at the moment

@@ -227,6 +250,10 @@ export const BuyButton = styled<{}, 'button'>('button')`
font-weight: bold;
font-size: 13px;
cursor: pointer;

&:disabled {
pointer-events: none;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly drop the opacity when disabled?

Copy link
Collaborator

@AlanBreck AlanBreck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Left a few minor comments.

@ryanml ryanml merged commit 742762a into master Oct 10, 2020
@ryanml ryanml deleted the fix-11960 branch October 10, 2020 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Widget] Add messaging within widget when currency is below min value
4 participants