File tree Expand file tree Collapse file tree 12 files changed +44
-38
lines changed Expand file tree Collapse file tree 12 files changed +44
-38
lines changed Original file line number Diff line number Diff line change 11import React from "react" ;
22import Highlight from "react-highlight" ;
3- import { install , usage } from "../ helpers/code" ;
4- import ContainerExample from ". /examples/ContainerExample" ;
5- import TypeExample from ". /examples/TypeExample" ;
6- import InsertExample from ". /examples/InsertExample" ;
7- import AnimationWrapper from ". /examples/AnimationExample" ;
8- import CustomContentExample from ". /examples/CustomContentExample" ;
9- import UsageExample from ". /examples/UsageExample" ;
3+ import { install , } from "helpers/code" ;
4+ import ContainerExample from "components /examples/ContainerExample" ;
5+ import TypeExample from "components /examples/TypeExample" ;
6+ import InsertExample from "components /examples/InsertExample" ;
7+ import AnimationWrapper from "components /examples/AnimationExample" ;
8+ import CustomContentExample from "components /examples/CustomContentExample" ;
9+ import UsageExample from "components /examples/UsageExample" ;
1010
1111function NPMInstall ( ) {
1212 return (
@@ -34,7 +34,7 @@ function ExampleHeading() {
3434 </ div >
3535 </ div >
3636 ) ;
37- } ;
37+ }
3838
3939const Examples = ( { addNotification } ) => {
4040 return (
Original file line number Diff line number Diff line change 11import React from "react" ;
22
3- export default function Header ( { instance } ) {
3+ export default function Header ( ) {
44 return (
55 < div className = "header" >
66 < div className = "header-content" >
@@ -9,6 +9,7 @@ export default function Header({ instance }) {
99 < div className = "header-buttons" >
1010 < a
1111 target = "_blank"
12+ rel = "noopener noreferrer"
1213 className = "btn btn-primary no-corner"
1314 href = { "https://github.com/teodosii/react-notifications-component" }
1415 >
Original file line number Diff line number Diff line change 11import React from "react" ;
2- import notification from "../../ helpers/notification" ;
2+ import notification from "helpers/notification" ;
33import {
44 getContainer ,
55 getType ,
6- getMessage ,
7- getTitle
8- } from "../../helpers/randomize" ;
6+ getMessage
7+ } from "helpers/randomize" ;
98
109function AnimationInExample ( { addNotification } ) {
1110 const add = ( htmlClasses ) => {
Original file line number Diff line number Diff line change 11import React from "react" ;
2- import notification from "../../ helpers/notification" ;
2+ import notification from "helpers/notification" ;
33import {
44 getType ,
55 getMessage ,
66 getTitle
7- } from "../../ helpers/randomize" ;
7+ } from "helpers/randomize" ;
88
99export default class ContainerExample extends React . Component {
1010 constructor ( props ) {
Original file line number Diff line number Diff line change 11import React from "react" ;
2- import notification from "../../ helpers/notification" ;
3- import reactImage from "../../../ images/react.png" ;
4- import { getContainer } from "../../ helpers/randomize" ;
2+ import notification from "helpers/notification" ;
3+ import reactImage from "images/react.png" ;
4+ import { getContainer } from "helpers/randomize" ;
55
66export default class CustomContentExample extends React . Component {
77 constructor ( props ) {
Original file line number Diff line number Diff line change 11import React from "react" ;
2- import notification from "../../ helpers/notification" ;
2+ import notification from "helpers/notification" ;
33import {
4- getContainer ,
54 getType ,
65 getMessage ,
76 getTitle
8- } from "../../ helpers/randomize" ;
7+ } from "helpers/randomize" ;
98
109export default function InsertExample ( { addNotification } ) {
1110 const add = ( insert ) => {
Original file line number Diff line number Diff line change 11import React from "react" ;
2- import notification from "../../ helpers/notification" ;
2+ import notification from "helpers/notification" ;
33import {
44 getContainer ,
55 getMessage ,
66 getTitle
7- } from "../../ helpers/randomize" ;
7+ } from "helpers/randomize" ;
88
99export default class TypeExample extends React . Component {
1010 constructor ( props ) {
Original file line number Diff line number Diff line change 11import React from "react" ;
22import Highlight from "react-highlight" ;
3- import { usage } from "../../helpers/code" ;
4- import notification from "../../helpers/notification" ;
5- import notificationObject from "../../../../tests/mocks/notification.mock" ;
3+ import { usage } from "helpers/code" ;
64
7- export default function UsageExample ( { addNotification } ) {
5+ export default function UsageExample ( ) {
86 return (
97 < div className = "row" >
108 < div className = "col-lg-8 offset-lg-2 column col-md-10 offset-md-1 col-sm-12 heading" >
Original file line number Diff line number Diff line change @@ -7,10 +7,11 @@ class App extends React.Component {
77 constructor(props) {
88 super(props);
99 this.addNotification = this.addNotification.bind(this);
10+ this.notificationDOMRef = React.createRef();
1011 }
1112
1213 addNotification() {
13- this.notificationDOMRef.addNotification({
14+ this.notificationDOMRef.current. addNotification({
1415 title: "Awesomeness",
1516 message: "Awesome Notifications!",
1617 type: "success",
@@ -26,7 +27,7 @@ class App extends React.Component {
2627 render() {
2728 return (
2829 <div className="app-content">
29- <ReactNotification ref={input => this.notificationDOMRef = input } />
30+ <ReactNotification ref={this.notificationDOMRef} />
3031 <button onClick={this.addNotification} className="btn btn-primary">
3132 Add Awesome Notification
3233 </button>
Original file line number Diff line number Diff line change 1- import React from "react" ;
2-
31export default {
42 title : "Awesomeness" ,
53 message : "Awesome Notifications!" ,
@@ -47,7 +45,7 @@ export default {
4745 delay : 0
4846 }
4947 } ,
50-
48+
5149 dismiss : {
5250 duration : 5000
5351 }
You can’t perform that action at this time.
0 commit comments