Created
December 21, 2019 19:57
-
-
Save muhshahabipour/577d60b52fc2a0caca51b1d9f2b2f6f4 to your computer and use it in GitHub Desktop.
react-notifications-component-homepage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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