@@ -14,7 +14,7 @@ You can import react-notification-alert in your application like so:
14
14
15
15
After that, in your component render method add the following line:
16
16
17
- ` <NotificationAlert ref="notificationAlert" /> `
17
+ ` <NotificationAlert ref="notificationAlert" zIndex={1031} onClick={() => console.log("hey")} /> `
18
18
19
19
We've used ` ref="notificationAlert" ` property on the ` NotificationAlert ` tag to access this components properties.
20
20
@@ -29,6 +29,12 @@ Do not forget to import our styles in your project:
29
29
import "react-notification-alert/dist/animate.css";
30
30
```
31
31
32
+ ## * zIndex*
33
+ If you want to add a special zIndex to the notification, if not, ` 9999 ` will be set as default.
34
+
35
+ ## * onClick*
36
+ This function will be called when the user clicks on a certain notification.
37
+
32
38
## * options* parameter
33
39
34
40
This parameter has to be a javascript object with the following props:
@@ -41,6 +47,7 @@ var options = {
41
47
icon: ,
42
48
autoDismiss: ,
43
49
closeButton: ,
50
+ zIndex: ,
44
51
}
45
52
```
46
53
@@ -105,7 +112,7 @@ class App extends Component {
105
112
render() {
106
113
return (
107
114
<div>
108
- <NotificationAlert ref="notify" />
115
+ <NotificationAlert ref="notify" zIndex={9999} onClick={() => console.log("hey")} />
109
116
<button onClick={() => this.myFunc()}>Hey</button>
110
117
</div>
111
118
);
@@ -132,5 +139,5 @@ npm install --save jquery
132
139
[ CHANGELOG ] : ./CHANGELOG.md
133
140
134
141
[ LICENSE ] : ./LICENSE.md
135
- [ version-badge ] : https://img.shields.io/badge/version-0.0.12 -blue.svg
142
+ [ version-badge ] : https://img.shields.io/badge/version-0.0.13 -blue.svg
136
143
[ license-badge ] : https://img.shields.io/badge/license-MIT-blue.svg
0 commit comments