From abb8ee5951c0f8995f95eae5eb229b6442dfb905 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 5 Dec 2022 23:49:20 +0100 Subject: [PATCH] core-components: rearrage AlertDisplay docs Signed-off-by: Patrik Oldsberg --- .../components/AlertDisplay/AlertDisplay.tsx | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/core-components/src/components/AlertDisplay/AlertDisplay.tsx b/packages/core-components/src/components/AlertDisplay/AlertDisplay.tsx index f1021b1f8b..b1c8273749 100644 --- a/packages/core-components/src/components/AlertDisplay/AlertDisplay.tsx +++ b/packages/core-components/src/components/AlertDisplay/AlertDisplay.tsx @@ -22,6 +22,19 @@ import { Alert } from '@material-ui/lab'; import pluralize from 'pluralize'; import React, { useEffect, useState } from 'react'; +/** + * Properties for {@link AlertDisplay} + * + * @public + */ +export type AlertDisplayProps = { + anchorOrigin?: { + vertical: 'top' | 'bottom'; + horizontal: 'left' | 'center' | 'right'; + }; + transientTimeoutMs?: number; +}; + /** * Displays alerts from {@link @backstage/core-plugin-api#AlertApi} * @@ -47,18 +60,6 @@ import React, { useEffect, useState } from 'react'; * * ``` */ - -// TODO: improve on this and promote to a shared component for use by all apps. - -export type AlertDisplayProps = { - anchorOrigin?: { - vertical: 'top' | 'bottom'; - horizontal: 'left' | 'center' | 'right'; - }; - transientTimeoutMs?: number; -}; - -/** @public */ export function AlertDisplay(props: AlertDisplayProps) { const [messages, setMessages] = useState>([]); const alertApi = useApi(alertApiRef);