mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-21 07:18:35 +00:00
* Add disclaimer modal to footer * Remove duplicate code & unnecessary styles * Fix formatting noise * remove un-used css style * Fix tslint error & add media query for modals * Nest Media Query * Add react-transition-group * Animate notifications with react-transition-group * Identify issue with notifications getting overridden * Update RTG (react-transition-group) to v2 & identify keys as animation issue * Add unique id on successful transactions for unique keys * update classNames, remove unused import * Revert removing lodash * Remove unnecessary test util * Remove formatting noise * Remove all formatting noise * Update CSS & Change notification unique id * Add unique id for each notification
31 lines
749 B
TypeScript
31 lines
749 B
TypeScript
import { ReactElement } from 'react';
|
|
import * as types from './actionTypes';
|
|
import { TypeKeys } from './constants';
|
|
|
|
export type TShowNotification = typeof showNotification;
|
|
export function showNotification(
|
|
level: types.NOTIFICATION_LEVEL = 'info',
|
|
msg: ReactElement<any> | string,
|
|
duration?: number | types.INFINITY
|
|
): types.ShowNotificationAction {
|
|
return {
|
|
type: TypeKeys.SHOW_NOTIFICATION,
|
|
payload: {
|
|
level,
|
|
msg,
|
|
duration,
|
|
id: Math.random()
|
|
}
|
|
};
|
|
}
|
|
|
|
export type TCloseNotification = typeof closeNotification;
|
|
export function closeNotification(
|
|
notification: types.Notification
|
|
): types.CloseNotificationAction {
|
|
return {
|
|
type: TypeKeys.CLOSE_NOTIFICATION,
|
|
payload: notification
|
|
};
|
|
}
|