-
Notifications
You must be signed in to change notification settings - Fork 893
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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'}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: disabled style
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
components/brave_new_tab_ui/components/default/bitcoinDotCom/style.ts
Outdated
Show resolved
Hide resolved
components/brave_new_tab_ui/components/default/bitcoinDotCom/style.ts
Outdated
Show resolved
Hide resolved
@@ -227,6 +250,10 @@ export const BuyButton = styled<{}, 'button'>('button')` | |||
font-weight: bold; | |||
font-size: 13px; | |||
cursor: pointer; | |||
|
|||
&:disabled { | |||
pointer-events: none; |
There was a problem hiding this comment.
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?
There was a problem hiding this 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.
Fixes brave/brave-browser#11960
Submitter Checklist:
npm run lint
,npm run gn_check
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).QA/Yes
orQA/No
) to the associated issuerelease-notes/include
orrelease-notes/exclude
) to the associated issueTest Plan:
Defined in issue
Reviewer Checklist:
After-merge Checklist:
changes has landed on.