aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/ui/alert.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/website/ts/components/ui/alert.tsx')
-rw-r--r--packages/website/ts/components/ui/alert.tsx27
1 files changed, 27 insertions, 0 deletions
diff --git a/packages/website/ts/components/ui/alert.tsx b/packages/website/ts/components/ui/alert.tsx
new file mode 100644
index 000000000..bf2f0baf5
--- /dev/null
+++ b/packages/website/ts/components/ui/alert.tsx
@@ -0,0 +1,27 @@
+import * as React from 'react';
+import {colors} from 'material-ui/styles';
+import {AlertTypes} from 'ts/types';
+
+const CUSTOM_GREEN = 'rgb(137, 199, 116)';
+
+interface AlertProps {
+ type: AlertTypes;
+ message: string|React.ReactNode;
+}
+
+export function Alert(props: AlertProps) {
+ const isAlert = props.type === AlertTypes.ERROR;
+ const errMsgStyles = {
+ background: isAlert ? colors.red200 : CUSTOM_GREEN,
+ color: 'white',
+ marginTop: 10,
+ padding: 4,
+ paddingLeft: 8,
+ };
+
+ return (
+ <div className="rounded center" style={errMsgStyles}>
+ {props.message}
+ </div>
+ );
+}