onClearNotification(appNotification.id)}
elevated
>
-
- {appNotification.component || appNotification.text}
- {appNotification.traceId && Trace ID: {appNotification.traceId}}
-
+ {hasBody && (
+
+ {appNotification.component || appNotification.text}
+ {appNotification.traceId && Trace ID: {appNotification.traceId}}
+
+ )}
);
}
diff --git a/public/app/core/components/AppNotifications/AppNotificationList.tsx b/public/app/core/components/AppNotifications/AppNotificationList.tsx
index 82723c43cb6..b27736e2ee0 100644
--- a/public/app/core/components/AppNotifications/AppNotificationList.tsx
+++ b/public/app/core/components/AppNotifications/AppNotificationList.tsx
@@ -1,12 +1,12 @@
-import React, { PureComponent } from 'react';
-import { connect, ConnectedProps } from 'react-redux';
+import { css } from '@emotion/css';
+import React, { useEffect } from 'react';
-import { AppEvents } from '@grafana/data';
-import { VerticalGroup } from '@grafana/ui';
+import { AppEvents, GrafanaTheme2 } from '@grafana/data';
+import { useStyles2, VerticalGroup } from '@grafana/ui';
import { notifyApp, hideAppNotification } from 'app/core/actions';
import appEvents from 'app/core/app_events';
import { selectVisible } from 'app/core/reducers/appNotification';
-import { StoreState } from 'app/types';
+import { useSelector, useDispatch } from 'app/types';
import {
createErrorNotification,
@@ -16,53 +16,48 @@ import {
import AppNotificationItem from './AppNotificationItem';
-export interface OwnProps {}
-
-const mapStateToProps = (state: StoreState, props: OwnProps) => ({
- appNotifications: selectVisible(state.appNotifications),
-});
-
-const mapDispatchToProps = {
- notifyApp,
- hideAppNotification,
-};
-
-const connector = connect(mapStateToProps, mapDispatchToProps);
-
-export type Props = OwnProps & ConnectedProps