From 9fdaa5832115269584ff98a5b245e96b5a649d54 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kuty=C5=82a?= Date: Thu, 27 Oct 2022 23:35:11 +0200 Subject: [PATCH] 18368: initial impl MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła --- src/index.css | 22 ++++++++++++++++++++++ src/views/workbench/workbench.tsx | 15 ++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/index.css b/src/index.css index 0172d68b..51f07761 100644 --- a/src/index.css +++ b/src/index.css @@ -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 diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx index a6c49e34..ae8a8f84 100644 --- a/src/views/workbench/workbench.tsx +++ b/src/views/workbench/workbench.tsx @@ -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 ? + : null; +} + export const WorkbenchPanel = withStyles(styles)((props: WorkbenchPanelProps) => @@ -270,6 +282,7 @@ export const WorkbenchPanel = + {React.createElement(React.Fragment, null, pluginConfig.dialogs)} ); -- 2.30.2