mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 06:40:50 +01:00
Update alerts
This commit is contained in:
parent
97141c2fcf
commit
d3908b1221
@ -1,7 +1,6 @@
|
||||
import { FC, useEffect, useState } from 'react';
|
||||
import { NitroLayoutFlexColumn } from '../../layout';
|
||||
import { NitroLayoutBase } from '../../layout/base';
|
||||
import { NotificationAlertType } from '../notification-center/common/NotificationAlertType';
|
||||
import { NotificationUtilities } from '../notification-center/common/NotificationUtilities';
|
||||
import { LoadingViewProps } from './LoadingView.types';
|
||||
|
||||
@ -14,7 +13,7 @@ export const LoadingView: FC<LoadingViewProps> = props =>
|
||||
{
|
||||
if(!isError) return;
|
||||
|
||||
NotificationUtilities.simpleAlert(message, NotificationAlertType.DEFAULT, null, null, 'Connection Error');
|
||||
NotificationUtilities.simpleAlert(message, null, null, null, 'Connection Error');
|
||||
}, [ isError, message ]);
|
||||
|
||||
useEffect(() =>
|
||||
|
@ -112,10 +112,12 @@ export class NotificationUtilities
|
||||
dispatchUiEvent(new NotificationAlertEvent(messages, NotificationAlertType.MOTD, null, null, LocalizeText('notifications.motd.title')));
|
||||
}
|
||||
|
||||
public static simpleAlert(message: string, type: string, clickUrl: string = null, clickUrlText: string = null, title: string = null, imageUrl: string = null): void
|
||||
public static simpleAlert(message: string, type: string = null, clickUrl: string = null, clickUrlText: string = null, title: string = null, imageUrl: string = null): void
|
||||
{
|
||||
if(!title || !title.length) title = LocalizeText('notifications.broadcast.title');
|
||||
|
||||
if(!type || !type.length) type = NotificationAlertType.DEFAULT;
|
||||
|
||||
dispatchUiEvent(new NotificationAlertEvent([ this.cleanText(message) ], type, clickUrl, clickUrlText, title, imageUrl));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user