-
Notifications
You must be signed in to change notification settings - Fork 193
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
feat: new error dialog design #511
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
non-blocking comments
src/components/Error/ErrorView.tsx
Outdated
margin: 0.5em; | ||
` | ||
|
||
const StyledXButton = styled(X)` |
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 feel like i've seen this component declared a couple times across the widget repo now, could we extract it into a single file and re-use via exporting?
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.
OH we actually have one already ! wow good catch
onDismiss={ | ||
error instanceof WidgetError && error.dismissable | ||
? () => { | ||
this.setState({ error: undefined }) |
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.
is there a reason behind why we're using a mix of class and functional react components in widget repo?
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.
yes - the ErrorBoundary needs to be a class component. this should be the only one afaik.
Only class components can be error boundaries. In practice, most of the time you’ll want to declare an error boundary component once and use it throughout your application.
https://reactjs.org/docs/error-boundaries.html#introducing-error-boundaries
🎉 This PR is included in version 2.44.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
design spec here
implements a new ErrorDialog design, building on the changes linked below.
note that I'm renaming
ErrorDialog
toErrorView
because it's not a dialog anymore. it will just be a regular inline-rendered component.depends on #507 , #508 , #509 , and #510 .