18368: initial impl
authorDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Thu, 27 Oct 2022 21:35:11 +0000 (23:35 +0200)
committerDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Thu, 27 Oct 2022 21:35:11 +0000 (23:35 +0200)
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>

src/index.css
src/views/workbench/workbench.tsx

index 0172d68bcc5c9385ebdbf29d7a06a7022ef08c96..51f07761d0d9b4ab4e990886138eec7d98ba08ab 100644 (file)
@@ -5,3 +5,25 @@ body {
     width: 100vw;
     height: 100vh;
 }
+
+.app-banner {
+    width: calc(100% - 2rem);
+    height: 150px;
+    z-index: 11111;
+    position: fixed;
+    top: 0px;
+    background-color: #00bfa5;
+    border: 1px solid #01685a;
+    color: #ffffff;
+    margin: 1rem;
+    box-sizing: border-box;
+    cursor: pointer;
+}
+
+.app-banner span {
+    font-size: 2rem;
+    text-align: center;
+    display: block;
+    margin: auto;
+    padding: 2rem;
+}
\ No newline at end of file
index a6c49e348495e6f48a21e1d8a99e6a78016a1e83..ae8a8f842d16f505d2c2fae3b84af665e59a39b5 100644 (file)
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import React from 'react';
+import React, { useState, useCallback } from 'react';
 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
 import { Route, Switch } from "react-router";
 import { ProjectPanel } from "views/project-panel/project-panel";
@@ -185,6 +185,18 @@ const reduceRoutesFn: (a: React.ReactElement[],
 
 routes = React.createElement(React.Fragment, null, pluginConfig.centerPanelList.reduce(reduceRoutesFn, React.Children.toArray(routes.props.children)));
 
+const Banner = () => {
+    const [visible, setVisible] = useState(true);
+    const hideBanner = useCallback(() => setVisible(false), []);
+
+    return visible ? 
+        <div id="banner" onClick={hideBanner} className="app-banner">
+            <span>
+            This is important message
+            </span>
+        </div> : null;
+}
+
 export const WorkbenchPanel =
     withStyles(styles)((props: WorkbenchPanelProps) =>
         <Grid container item xs className={props.classes.root}>
@@ -270,6 +282,7 @@ export const WorkbenchPanel =
             <VirtualMachineAttributesDialog />
             <FedLogin />
             <WebDavS3InfoDialog />
+            <Banner />
             {React.createElement(React.Fragment, null, pluginConfig.dialogs)}
         </Grid>
     );