summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorKamran Ahmed <kamranahmed.se@gmail.com>2018-08-28 15:47:02 +0500
committerKamran Ahmed <kamranahmed.se@gmail.com>2018-08-28 15:47:02 +0500
commitf441166a3bf27c145a48ae2350cd8cd0931504e9 (patch)
treecad4e80d88d6910cda192ec3f1f0d4d80f71f331 /src/components
parentAlert for token (diff)
downloadgithunt-f441166a3bf27c145a48ae2350cd8cd0931504e9.tar.gz
Refactor and add error handling
Diffstat (limited to 'src/components')
-rw-r--r--src/components/alert/index.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/components/alert/index.js b/src/components/alert/index.js
new file mode 100644
index 0000000..7d04355
--- /dev/null
+++ b/src/components/alert/index.js
@@ -0,0 +1,13 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import classnames from 'classnames';
+
+const Alert = (props) => (
+ <div className={ classnames('alert', `alert-${props.type}`) }>{ props.children }</div>
+);
+
+Alert.propTypes = {
+ type: PropTypes.string.isRequired
+};
+
+export default Alert;