Skip to content
This repository has been archived by the owner on Dec 24, 2019. It is now read-only.

Commit

Permalink
Merge pull request #149 from sh3nan1gans/master
Browse files Browse the repository at this point in the history
Add onClick prop to NotificationStack definition
Patrick Burtchaell authored Aug 18, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 29f19a7 + 28d05bb commit 2a1641a
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -4,7 +4,17 @@ interface StyleFactoryFn {
(index: number, style: object | void, notification: NotificationProps): object;
}

interface NotificationProps {
interface OnClickNotificationProps {
/**
* Callback function to run when the action is clicked.
* @param notification Notification currently being clicked
* @param deactivate Function that can be called to set the notification to inactive.
* Used to activate notification exit animation on click.
*/
onClick?(notification: NotificationProps, deactivate: () => void): void;
}

interface NotificationProps extends OnClickNotificationProps {
/** The name of the action, e.g., "close" or "undo". */
action?: string;
/** Custom action styles. */
@@ -38,21 +48,15 @@ interface NotificationProps {
title?: string | ReactElement<any>;
/** Custom title styles. */
titleStyle?: object;
/**
* Callback function to run when the action is clicked.
* @param notification Notification currently being clicked
* @param deactivate Function that can be called to set the notification to inactive.
* Used to activate notification exit animation on click.
*/
onClick?(notification: NotificationProps, deactivate: () => void): void;

/**
* Callback function to run when dismissAfter timer runs out
* @param notification Notification currently being dismissed.
*/
onDismiss?(notification: NotificationProps): void;
}

interface NotificationStackProps {
interface NotificationStackProps extends OnClickNotificationProps {
/** Create the style of the actions. */
actionStyleFactory?: StyleFactoryFn;
/** Create the style of the active notification. */

0 comments on commit 2a1641a

Please sign in to comment.