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

feat: new error dialog design #511

Merged
merged 7 commits into from
Mar 2, 2023
Merged

Conversation

just-toby
Copy link
Collaborator

@just-toby just-toby commented Feb 24, 2023

design spec here

implements a new ErrorDialog design, building on the changes linked below.

note that I'm renaming ErrorDialog to ErrorView because it's not a dialog anymore. it will just be a regular inline-rendered component.

depends on #507 , #508 , #509 , and #510 .

@vercel
Copy link

vercel bot commented Feb 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
widgets ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 2, 2023 at 7:47PM (UTC)

@just-toby just-toby changed the title Feat/new error modal design feat: new error modal design Feb 24, 2023
@vercel vercel bot temporarily deployed to Preview February 28, 2023 18:45 Inactive
@vercel vercel bot temporarily deployed to Preview February 28, 2023 18:47 Inactive
@just-toby just-toby marked this pull request as ready for review February 28, 2023 18:50
@vercel vercel bot temporarily deployed to Preview February 28, 2023 18:51 Inactive
@just-toby just-toby changed the title feat: new error modal design feat: new error dialog design Feb 28, 2023
Copy link
Contributor

@lynnshaoyu lynnshaoyu left a comment

Choose a reason for hiding this comment

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

non-blocking comments

margin: 0.5em;
`

const StyledXButton = styled(X)`
Copy link
Contributor

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?

Copy link
Collaborator Author

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 })
Copy link
Contributor

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?

Copy link
Collaborator Author

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

@just-toby just-toby merged commit 241b21c into main Mar 2, 2023
@just-toby just-toby deleted the feat/new-error-modal-design branch March 2, 2023 19:40
@github-actions
Copy link

github-actions bot commented Mar 2, 2023

🎉 This PR is included in version 2.44.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@vercel vercel bot temporarily deployed to Preview March 2, 2023 19:47 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants