[ARVADOS-WORKBENCH2] created: 1.1.4-291-g96c03a9
Git user
git at public.curoverse.com
Fri Jul 13 12:09:38 EDT 2018
at 96c03a921fe8e8e3c5de4333ea7d1456297f2681 (commit)
commit 96c03a921fe8e8e3c5de4333ea7d1456297f2681
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date: Fri Jul 13 18:09:24 2018 +0200
snackbar component
Feature #13782
Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
diff --git a/src/components/snackbar/snackbar.tsx b/src/components/snackbar/snackbar.tsx
new file mode 100644
index 0000000..a452f83
--- /dev/null
+++ b/src/components/snackbar/snackbar.tsx
@@ -0,0 +1,44 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import Button from '@material-ui/core/Button';
+import Snackbar from '@material-ui/core/Snackbar';
+
+type SnackbarProps = {
+ message: string
+};
+
+interface SnackbarState {
+ open: boolean;
+}
+
+export default class SnackbarComponent extends React.Component<SnackbarProps> {
+ state: SnackbarState = {
+ open: false
+ };
+
+ handleClick = () => {
+ this.setState({ open: true });
+ }
+
+ render() {
+ const { open } = this.state;
+ const { message } = this.props;
+ return (
+ <div>
+ <Button onClick={this.handleClick}>
+ CLICK
+ </Button>
+ <Snackbar
+ open={open}
+ autoHideDuration={AUTO_HIDE_DURATION}
+ message={<span id="message-id">{message}</span>}
+ />
+ </div>
+ );
+ }
+}
+
+const AUTO_HIDE_DURATION = 6000;
\ No newline at end of file
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list