mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
fix adapting of legacy notification to the new toast system
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9415 GitOrigin-RevId: bfc3d9f18a459e74b9f2b37dac6c4858c26acefa
This commit is contained in:
parent
092be72ac1
commit
0407229c83
@ -58,6 +58,13 @@ export const showNotification = (
|
||||
toast.remove();
|
||||
}
|
||||
|
||||
if (options?.action && options?.action?.callback) {
|
||||
toastProps.button = {
|
||||
label: options.action.label,
|
||||
onClick: options.action.callback,
|
||||
};
|
||||
}
|
||||
|
||||
if (options.alternateActionButtonProps) {
|
||||
toastProps.button = {
|
||||
label: options.alternateActionButtonProps.label,
|
||||
@ -70,13 +77,13 @@ export const showNotification = (
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof options?.title === 'object' && toastProps?.children) {
|
||||
if (typeof options?.title === 'object') {
|
||||
titleAsNode = options.title;
|
||||
} else if (typeof options?.title === 'string') {
|
||||
toastProps.title = options.title;
|
||||
}
|
||||
|
||||
if (typeof options?.message === 'object' && toastProps?.children) {
|
||||
if (typeof options?.message === 'object') {
|
||||
messageAsNode = options.message;
|
||||
} else if (typeof options?.message === 'string') {
|
||||
toastProps.message = options.message;
|
||||
|
Loading…
Reference in New Issue
Block a user