-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
73 changed files
with
5,029 additions
and
3,297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,6 @@ node_modules | |
/api/index.js | ||
/api/index.js.map | ||
|
||
*.log | ||
*.log | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
import styled from '@emotion/styled'; | ||
import { isRouteErrorResponse, useRouteError } from '@remix-run/react'; | ||
|
||
const Container = styled('div')` | ||
background-color: #ff0000; | ||
padding: 1rem; | ||
`; | ||
import { Typography } from './typography'; | ||
import { Card } from './ui/card'; | ||
|
||
export const ErrorBoundary = () => { | ||
const error = useRouteError(); | ||
|
||
return isRouteErrorResponse(error) ? ( | ||
<Container> | ||
<h1>{`${error.status} - ${error.data}`}</h1> | ||
</Container> | ||
) : ( | ||
<Container> | ||
<p>[ErrorBoundary]: There was an error: {(error as Error).message}</p> | ||
</Container> | ||
return ( | ||
<Card className='bg-red-500'> | ||
<Typography variant='h3'>Something went wrong</Typography> | ||
{isRouteErrorResponse(error) ? ( | ||
<Typography>{`${error.status} - ${error.data}`}</Typography> | ||
) : error instanceof Error ? ( | ||
<> | ||
<Typography>{`${error.name}: ${error.message}`}</Typography> | ||
{process.env.NODE_ENV !== 'production' && ( | ||
<Card> | ||
<Typography variant='small'>Stack:</Typography> | ||
<Typography variant='small' className='mt-2 whitespace-break-spaces font-mono'> | ||
{error.stack} | ||
</Typography> | ||
</Card> | ||
)} | ||
</> | ||
) : ( | ||
<Typography>Unknown error</Typography> | ||
)} | ||
</Card> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.