diff options
| author | Ernst Widerberg <ernstwi@kth.se> | 2021-10-06 16:11:06 +0200 |
|---|---|---|
| committer | Ernst Widerberg <ernstwi@kth.se> | 2021-10-06 16:11:06 +0200 |
| commit | 46b9df3279f51479cfc607cbce8fb8b73bef69f7 (patch) | |
| tree | ddca9489ce2779c5c7c23938cb5e666387ace775 /src/components/Error.js | |
Initial commit
Diffstat (limited to 'src/components/Error.js')
| -rw-r--r-- | src/components/Error.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/components/Error.js b/src/components/Error.js new file mode 100644 index 0000000..56cc09c --- /dev/null +++ b/src/components/Error.js @@ -0,0 +1,33 @@ +import React from "react"; +import PropTypes from "prop-types"; +import { Button, Message } from "semantic-ui-react"; + +class Error extends React.Component { + static propTypes = { + clearError: PropTypes.func.isRequired, + clearToken: PropTypes.func.isRequired, + error: PropTypes.string.isRequired + }; + + render() { + return ( + <div id="error-container"> + <Message negative> + <Message.Header>Internal server error</Message.Header> + <p>{this.props.error}</p> + <Button + color="red" + onClick={() => { + this.props.clearToken(); + this.props.clearError(); + }} + > + Sign out + </Button> + </Message> + </div> + ); + } +} + +export default Error; |
