forked from terra-money/wormhole
-
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.
bridge_ui: more safety checks and feedback messages
fixes wormhole-foundation#372 fixes wormhole-foundation#366 Change-Id: Ieefdd2f04e353d4a68204864bfa91e8e8ebafc30
- Loading branch information
Showing
17 changed files
with
371 additions
and
85 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Typography } from "@material-ui/core"; | ||
import React from "react"; | ||
|
||
export default class ErrorBoundary extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { hasError: false }; | ||
} | ||
|
||
static getDerivedStateFromError(error) { | ||
return { hasError: true }; | ||
} | ||
|
||
componentDidCatch(error, errorInfo) { | ||
console.error(error, errorInfo); | ||
} | ||
|
||
render() { | ||
if (this.state.hasError) { | ||
return ( | ||
<Typography variant="h5" style={{ textAlign: "center", marginTop: 24 }}> | ||
An unexpected error has occurred. Please refresh the page. | ||
</Typography> | ||
); | ||
} | ||
|
||
return this.props.children; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { makeStyles, Typography } from "@material-ui/core"; | ||
import { ReactChild } from "react"; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
description: { | ||
marginBottom: theme.spacing(4), | ||
}, | ||
})); | ||
|
||
export default function StepDescription({ | ||
children, | ||
}: { | ||
children: ReactChild; | ||
}) { | ||
const classes = useStyles(); | ||
return ( | ||
<Typography component="div" variant="body2" className={classes.description}> | ||
{children} | ||
</Typography> | ||
); | ||
} |
Oops, something went wrong.