Comments (6)
Hey @joelclaudio ,
You can use it as in example => https://github.com/gor181/react-notification-system-redux/blob/master/example/src/components/container.js#L7-L17
this.context.store.dispatch(Notifications.succss({
// uid: 'once-please', // you can specify your own uid if required
title: 'Hey, it\'s good to see you!',
message: 'Now you can see how easy it is to use notifications in React!',
position: 'tr',
autoDismiss: 0,
action: {
label: 'Click me!!',
callback: () => alert('clicked!')
},
style: false,
noAnimation: true
}));
Same example is already in the readme: https://github.com/gor181/react-notification-system-redux#usage
All information you need should be initiated via actions and shouldn't be passed as props to the <Notifications />
component. Please check how to setup in the readme.
Let me know if you have any questions. 🍺
from react-notification-system-redux.
Thanks for your reply.
For some reason I can't seem to make this work on my side. For sanity's sake I decided to clone your repository and tried to change your example-code at
react-notification-system-redux/example/src/components/container.js
in 3 variants:
const notificationOpts = {
// uid: 'once-please', // you can specify your own uid if required
title: 'Hey, it\'s good to see you!',
message: 'Now you can see how easy it is to use notifications in React!',
position: 'tc',
autoDismiss: 5,
action: {
label: 'Click me!!',
callback: () => alert('clicked!')
},
style: false,
noAnimation: true
};
const notificationOpts = {
// uid: 'once-please', // you can specify your own uid if required
title: 'Hey, it\'s good to see you!',
message: 'Now you can see how easy it is to use notifications in React!',
position: 'tc',
autoDismiss: 5,
action: {
label: 'Click me!!',
callback: () => alert('clicked!')
},
style: {color: '#ff0000'},
};
const notificationOpts = {
// uid: 'once-please', // you can specify your own uid if required
title: 'Hey, it\'s good to see you!',
message: 'Now you can see how easy it is to use notifications in React!',
position: 'tc',
autoDismiss: 5,
action: {
label: 'Click me!!',
callback: () => alert('clicked!')
},
style: {
NotificationItem: { // Override the notification item
DefaultStyle: { // Applied to every notification, regardless of the notification level
margin: '10px 5px 2px 1px'
},
success: { // Applied only to the success notification item
color: 'red'
}
}
}
};
Although the changes that I made to the autoDismiss and position fields worked, the ones made to style and noAnimation. It's possible that I am missing something here. Can you please help?
Thanks 👍
from react-notification-system-redux.
Hey @joelclaudio ,
Trying it out now.
Cheers,
from react-notification-system-redux.
Hey @joelclaudio ,
You were right! 🍺 There was a bug with it. I have just released a new version addressing that, a simple npm uninstall
and then npm i
should do it.
So how you do it is:
const style = {
NotificationItem: { // Override the notification item
DefaultStyle: { // Applied to every notification, regardless of the notification level
margin: '10px 5px 2px 1px'
},
success: { // Applied only to the success notification item
color: 'red'
}
}
}
<Notifications notifications={notifications} style={style} noAnimation />
It supports any properties which NotifySystem does.
Please let me know if it works for you.
Cheers,
from react-notification-system-redux.
Thanks @gor181,
It's working, I can now customise the notifications styling. :)
One more thing: I used the noAnimation flag and didn't see any change in the notifications behaviour. I don't know if there is a problem with your wrapper, the react-notification-system or even my interpretation on what this flag does ( https://github.com/igorprado/react-notification-system#important-1 ).
The thing is I don't need the noAnimation flag so for me your system works spectacularly.
Thank you very much for your time put into this, it helped us a lot in our implementation. :)
from react-notification-system-redux.
Hey @joelclaudio ,
Thanks for reporting back.
Yes I also had issues with testing the noAnimation
property, but from what I see it's being sent to the react-notification-system component, so It's definitely something which sould be addressed to the original project if needed.
Anyways, thanks for reporting and helping in testing it out.
Cheerio!
from react-notification-system-redux.
Related Issues (20)
- Does it working with IE11? HOT 1
- Ability to limit the max # of notifications displayed in the UI? HOT 1
- is `allowHTML` supported? HOT 2
- Can I re-render a notification? HOT 1
- [question] Showing notifications makes browser to scroll up
- different styling when using multiple components
- [suggestions] improve docs and info
- react-redux v6.x support HOT 4
- context.store undefined (React 16 + Redux 4) HOT 1
- Feature request: Remove notifications by level
- Uncaught TypeError: Cannot read property 'dispatch' of undefined HOT 6
- TypeError: Cannot read property 'map' of null
- Update Peer Dependencies to support react-redux v7.x HOT 4
- react-notification-system Warning with React 16.0.9 HOT 1
- Hooks api HOT 1
- update peer dependency for react-notification-system HOT 1
- why is there a react version restriction HOT 2
- Update to be used along with react 18 HOT 1
- Come here if you want to make it work with react 17 or 18
- onRemove should pass in notification
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-notification-system-redux.