Skip to content

Instantly share code, notes, and snippets.

@muhshahabipour
Created December 21, 2019 19:57
Show Gist options
  • Save muhshahabipour/577d60b52fc2a0caca51b1d9f2b2f6f4 to your computer and use it in GitHub Desktop.
Save muhshahabipour/577d60b52fc2a0caca51b1d9f2b2f6f4 to your computer and use it in GitHub Desktop.
react-notifications-component-homepage
import React from 'react';
import { store } from 'react-notifications-component';
import 'react-notifications-component/dist/theme.css';
import 'animate.css';
function Homepage() {
return (
<>
My Website
<button
onClick={() => {
store.addNotification({
title: 'Dropbox',
message: 'Files were synced',
type: 'default', // 'default', 'success', 'info', 'warning'
container: 'bottom-left', // where to position the notifications
animationIn: ["animated", "fadeIn"], // animate.css classes that's applied
animationOut: ["animated", "fadeOut"], // animate.css classes that's applied
dismiss: {
duration: 3000
}
})
}}
>
Add notification
</button>
</>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment