Changes to use display over transient property
Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com>
This commit is contained in:
@@ -64,7 +64,7 @@ export function AlertDisplay(props: AlertDisplayProps) {
|
||||
|
||||
useEffect(() => {
|
||||
const [current] = messages;
|
||||
if (current && current.transient)
|
||||
if (current && current.display === 'transient')
|
||||
setTimeout(() => {
|
||||
setMessages(msgs => msgs.filter(msg => msg !== current));
|
||||
}, timeoutMs);
|
||||
|
||||
@@ -29,7 +29,7 @@ export const alertApiRef: ApiRef<AlertApi>;
|
||||
export type AlertMessage = {
|
||||
message: string;
|
||||
severity?: 'success' | 'info' | 'warning' | 'error';
|
||||
transient?: boolean;
|
||||
display?: 'permanent' | 'transient';
|
||||
};
|
||||
|
||||
// @public
|
||||
|
||||
@@ -26,7 +26,7 @@ export type AlertMessage = {
|
||||
message: string;
|
||||
// Severity will default to success since that is what material ui defaults the value to.
|
||||
severity?: 'success' | 'info' | 'warning' | 'error';
|
||||
transient?: boolean;
|
||||
display?: 'permanent' | 'transient';
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user