From 91662d302f7f376a679f08ae0918e16d357c5a0d Mon Sep 17 00:00:00 2001 From: Grégoire Aubert Date: Tue, 24 Oct 2017 09:41:22 +0200 Subject: SONAR-9936 Make the edition notifications global again --- .../sonar-web/src/main/js/components/nav/NavBar.css | 5 +++++ .../src/main/js/components/nav/NavBarNotif.tsx | 20 +++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'server/sonar-web/src/main/js/components') diff --git a/server/sonar-web/src/main/js/components/nav/NavBar.css b/server/sonar-web/src/main/js/components/nav/NavBar.css index fb9393dd02e..0a24b4232ad 100644 --- a/server/sonar-web/src/main/js/components/nav/NavBar.css +++ b/server/sonar-web/src/main/js/components/nav/NavBar.css @@ -28,3 +28,8 @@ border-right: none; padding: 6px 0; } + +.navbar-notif-cancelable { + display: flex; + justify-content: space-between; +} diff --git a/server/sonar-web/src/main/js/components/nav/NavBarNotif.tsx b/server/sonar-web/src/main/js/components/nav/NavBarNotif.tsx index 9004c1b7fe9..c276e20f62f 100644 --- a/server/sonar-web/src/main/js/components/nav/NavBarNotif.tsx +++ b/server/sonar-web/src/main/js/components/nav/NavBarNotif.tsx @@ -19,20 +19,38 @@ */ import * as React from 'react'; import * as classNames from 'classnames'; +import CloseIcon from '../icons-components/CloseIcon'; interface Props { children?: React.ReactNode; className?: string; + onCancel?: () => {}; } export default class NavBarNotif extends React.PureComponent { + handleCancel = (event: React.SyntheticEvent) => { + event.preventDefault(); + if (this.props.onCancel) { + this.props.onCancel(); + } + }; + render() { if (!this.props.children) { return null; } return (
-
{this.props.children}
+
+
+ {this.props.children} + {this.props.onCancel && ( + + + + )} +
+
); } -- cgit v1.2.3