summaryrefslogtreecommitdiff
path: root/src/components/Error.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Error.js')
-rw-r--r--src/components/Error.js33
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;