Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
2b06615 to
1c1457c
Compare
1c1457c to
30420c7
Compare
30420c7 to
0121122
Compare
0121122 to
d22ec1c
Compare
d22ec1c to
6baf863
Compare
| ); | ||
|
|
||
| export function DeveloperErrorDisplay(props: { error: DeveloperError }) { | ||
| export function DeveloperErrorDisplay({ error }: { error: DeveloperError }) { |
There was a problem hiding this comment.
I did a few of these refactorings.
| <Alert variant="destructive"> | ||
| <CircleX /> | ||
| <AlertTitle>{error.message}</AlertTitle> | ||
| {error.path.length > 0 && ( | ||
| <AlertDescription> |
There was a problem hiding this comment.
This is the pattern for these alerts - Alert, icon, AlertTitle, AlertDescription.
| {error.path.map((item) => ( | ||
| <li key={item}>{item}</li> | ||
| ))} |
There was a problem hiding this comment.
Using item as key here is better.
| {!services.problemService.hasProblems && <span>No problems found</span>} | ||
| {services.problemService.invalidRelationships.map( |
There was a problem hiding this comment.
This is just flattening props.
| <Alert variant={isError ? "destructive" : "default"}> | ||
| {isError ? <CircleX /> : <MessageCircleWarning />} | ||
| <AlertDescription> | ||
| {Object.entries(parsed).map(([key, value]) => { |
There was a problem hiding this comment.
Entries is more ergonomic here.
| toast.error("Error sharing", { | ||
| description: errorData.error || "Failed to share playground", |
There was a problem hiding this comment.
We're refactoring showAlert to use the toast function from sonner. This is where ShadCN went with this kind of functionality. We can change where we want the toasts to show if we want; currently it's the bottom-right corner.
src/playground-ui/AlertDialog.tsx
Outdated
There was a problem hiding this comment.
This was superseded by the AlertDialog component from Shadcn.
src/playground-ui/AlertProvider.tsx
Outdated
There was a problem hiding this comment.
No longer necessary with Sonner.
There was a problem hiding this comment.
This is a relic from the CRA days.
| <> | ||
| <Toaster /> |
There was a problem hiding this comment.
This is just adding the <Toaster /> component and renesting things.
6baf863 to
6f5dc98
Compare
Description
Part of getting this project off of material-ui. This refactors snackbars to use sonners and MUI alerts to use ShadCN alerts.
Changes
Will annotate.
Testing
Review. See that the popups and alerts still look good.