Giter Site home page Giter Site logo

Comments (6)

gor181 avatar gor181 commented on September 12, 2024

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.

joelclaudio avatar joelclaudio commented on September 12, 2024

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.

gor181 avatar gor181 commented on September 12, 2024

Hey @joelclaudio ,

Trying it out now.

Cheers,

from react-notification-system-redux.

gor181 avatar gor181 commented on September 12, 2024

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.

joelclaudio avatar joelclaudio commented on September 12, 2024

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.

gor181 avatar gor181 commented on September 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.