packages/app: move AlertDisplay to core

This commit is contained in:
Patrik Oldsberg
2020-05-25 18:10:34 +02:00
parent e1f31ed95a
commit 6d3f745b4b
6 changed files with 6 additions and 8 deletions
-1
View File
@@ -18,7 +18,6 @@
"@backstage/plugin-sentry": "^0.1.1-alpha.6",
"@material-ui/core": "^4.9.1",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"prop-types": "^15.7.2",
"react": "^16.12.0",
"react-dom": "^16.12.0",
+1 -2
View File
@@ -14,11 +14,10 @@
* limitations under the License.
*/
import { createApp, OAuthRequestDialog } from '@backstage/core';
import { createApp, AlertDisplay, OAuthRequestDialog } from '@backstage/core';
import React, { FC } from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Root from './components/Root';
import AlertDisplay from './components/AlertDisplay';
import * as plugins from './plugins';
import apis, { alertApiForwarder } from './apis';
+1
View File
@@ -31,6 +31,7 @@
"@backstage/theme": "^0.1.1-alpha.6",
"@material-ui/core": "^4.9.1",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@types/classnames": "^2.2.9",
"@types/google-protobuf": "^3.7.2",
"@types/jest": "^25.2.2",
@@ -19,14 +19,14 @@ import PropTypes from 'prop-types';
import { Snackbar, IconButton } from '@material-ui/core';
import CloseIcon from '@material-ui/icons/Close';
import { Alert } from '@material-ui/lab';
import { AlertApiForwarder, AlertMessage } from '@backstage/core';
import { AlertApiForwarder, AlertMessage } from '../../api';
type Props = {
forwarder: AlertApiForwarder;
};
// TODO: improve on this and promote to a shared component for use by all apps.
const AlertDisplay: FC<Props> = ({ forwarder }) => {
export const AlertDisplay: FC<Props> = ({ forwarder }) => {
const [messages, setMessages] = useState<Array<AlertMessage>>([]);
useEffect(() => {
@@ -73,5 +73,3 @@ const AlertDisplay: FC<Props> = ({ forwarder }) => {
AlertDisplay.propTypes = {
forwarder: PropTypes.instanceOf(AlertApiForwarder).isRequired,
};
export default AlertDisplay;
@@ -14,4 +14,4 @@
* limitations under the License.
*/
export { default } from './AlertDisplay';
export * from './AlertDisplay';
+1
View File
@@ -28,6 +28,7 @@ export { default as InfoCard } from './layout/InfoCard';
export { CardTab, TabbedCard } from './layout/TabbedCard';
export { default as ErrorBoundary } from './layout/ErrorBoundary';
export * from './layout/Sidebar';
export { AlertDisplay } from './components/AlertDisplay';
export { default as HorizontalScrollGrid } from './components/HorizontalScrollGrid';
export { default as ProgressCard } from './components/ProgressBars/ProgressCard';
export { default as CircleProgress } from './components/ProgressBars/CircleProgress';