mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 01:12:56 +03:00
console: make error notifications dismissible only after clicking on the close button (close #5533) (#5780)
https://github.com/hasura/graphql-engine/pull/5780
This commit is contained in:
parent
ee00315ffb
commit
daeb1209ab
@ -16,7 +16,7 @@ const CONNECTION_FAILED = 'App/CONNECTION_FAILED';
|
||||
* title: string null
|
||||
* message: string null
|
||||
* autoDismiss: integer 5, set to 0 to not auto-dismiss
|
||||
* dismissible: bool true, set if user can dismiss notification
|
||||
* dismissible: 'button', set if the user can dismiss the notification, false otherwise
|
||||
* action: object null, action button with label string and callback function
|
||||
* children: element/string, null, add custom element, over-rides action
|
||||
* onAdd: function, null, called when notification is successfully created, 1st argument is the notification
|
||||
|
@ -20,7 +20,7 @@ export interface Notification {
|
||||
level?: 'error' | 'warning' | 'info' | 'success';
|
||||
position?: 'tr' | 'tl' | 'tc' | 'br' | 'bl' | 'bc';
|
||||
autoDismiss?: number;
|
||||
dismissible?: boolean;
|
||||
dismissible?: 'both' | 'button' | 'click' | 'hide' | 'none' | boolean;
|
||||
children?: React.ReactNode;
|
||||
uid?: number | string;
|
||||
action?: {
|
||||
@ -43,7 +43,9 @@ export const showNotification = (
|
||||
{
|
||||
position: options.position || 'tr',
|
||||
autoDismiss: ['error', 'warning'].includes(level) ? 0 : 5,
|
||||
dismissible: ['error', 'warning'].includes(level),
|
||||
dismissible: ['error', 'warning'].includes(level)
|
||||
? ('button' as any) // bug in @types/react-notification-system-redux types
|
||||
: ('click' as any),
|
||||
...options,
|
||||
},
|
||||
level
|
||||
|
Loading…
Reference in New Issue
Block a user