-
Notifications
You must be signed in to change notification settings - Fork 885
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
Added purchase failed panel #13486
Added purchase failed panel #13486
Conversation
import getPanelBrowserAPI, * as BraveVPN from '../../api/panel_browser_api' | ||
import { CaratStrongLeftIcon } from 'brave-ui/components/icons' | ||
|
||
interface Props { | ||
onCloseContactSupport: React.MouseEventHandler<HTMLButtonElement> |
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.
this is used outside only by empty callbacks to setup flags, seems not necessary to pass React.MouseEventHandler
@petemill ? and I added auto closing of this panel to be more user friendly when request is success
A Storybook has been deployed to preview UI for the latest push |
A Storybook has been deployed to preview UI for the latest push |
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.
Nice work and cleanup, but some small changes I think
@@ -0,0 +1,54 @@ | |||
import styled from 'styled-components' |
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.
Since this is the only file in this directory, how about we avoid the name repetition and just put components/styles.ts
instead of components/styles/styles.ts
?
Or perhaps a better idea, since these aren't really styles but are components, call them something like components/general.ts
?
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
<message name="IDS_BRAVE_VPN_LOADING" desc="Label to show below loader icon"> | ||
One moment while loading… | ||
</message> | ||
|
||
<message name="IDS_BRAVE_VPN_PURCHASE_FAILED " desc="Label to show when purchase status failed"> | ||
Unable to check the status of your purchase, probably a network problem. |
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.
How about "Unable to check the status of your purchase. This could be caused by a network problem."
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
{getLocale('braveVpnContactSupport')} | ||
</S.ButtonText> | ||
} | ||
{isContactSupportVisible && |
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.
I think it looks a little strange to put the support contact form underneath the error. Perhaps we do it like the existing contact form instance, and just replace the UI here (if (isContactSupportVisible) return <ContactSupport ...>
).
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.
good idea, thanks,
Brave.Browser.Development.-.Settings.-.2.June.2022.mp4
function PurchaseFailedPanel () { | ||
const [isContactSupportVisible, setContactSupportVisible] = React.useState(false) | ||
const closeContactSupport = () => { | ||
console.log('isContactSupportVisible', isContactSupportVisible) |
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: remove logging
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
A Storybook has been deployed to preview UI for the latest push |
A Storybook has been deployed to preview UI for the latest push |
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.
I wasn't able to figure out how to block in Fiddler, so I just made hostname non-routable using hostfile. Works great! Before we release, we'll want to review all the strings - I don't think these error states were captured in Figma. Code changes look great too! 😄👍
A Storybook has been deployed to preview UI for the latest push |
A Storybook has been deployed to preview UI for the latest push |
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.
nice
Resolves brave/brave-browser#23028
Resolves brave/brave-browser#22731
connect-api.guardianapp.com
is unavailable often for me and I see infinite loading state because the purchase check failed is not handled properly on typescript side2022-05-26_17h02_26.mp4
Brave.Browser.Development.-.Settings.-.2.June.2022.mp4
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: