Skip to content

Commit

Permalink
style(ui): updated error boundary UI
Browse files Browse the repository at this point in the history
Updated the error boundary UI to use new icons and styles.

- Replaced the Icon component with the ExclamationTriangleIcon from the new heroicons package.
- Changed the background color of the error boundary to a gradient.
- Increased the size of the error icon.
- Added an animation to the error icon.
- Changed the text of the refresh button to "Return to Home".
- Updated the padding of the error boundary.
  • Loading branch information
luandro committed Sep 6, 2024
1 parent 0543165 commit a4609a4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/ErrorBoundary.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React from 'react';
import { ExclamationTriangleIcon } from '@radix-ui/react-icons';
import { ExclamationTriangleIcon } from '@heroicons/react/24/solid';

const ErrorBoundary = ({ error }) => (
<div className="flex items-center justify-center min-h-screen bg-gray-100">
<div className="max-w-md w-full bg-white shadow-lg rounded-lg p-8 text-center">
<ExclamationTriangleIcon className="w-16 h-16 text-red-500 mx-auto mb-4" />
<div className="flex items-center justify-center min-h-screen bg-gradient-to-br from-gray-100 to-gray-200">
<div className="max-w-md w-full bg-white shadow-2xl rounded-lg p-10 text-center transform hover:scale-105 transition-all duration-300">
<ExclamationTriangleIcon className="w-20 h-20 text-red-500 mx-auto mb-6 animate-pulse" />
<h1 className="text-2xl font-bold text-gray-800 mb-4">Oops! Something went wrong.</h1>
<p className="text-gray-600 mb-6">{error?.message || 'An unexpected error occurred.'}</p>
<button
onClick={() => window.location.reload()}
onClick={() => window.location.href = '/'}
className="bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded transition duration-300"
>
Refresh Page
Return to Home
</button>
</div>
</div>
Expand Down

0 comments on commit a4609a4

Please sign in to comment.