0.2.0 • Published 5 years ago

rdm-notifications v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Notifications module for "redux dyanmic modules" enabled projects.

Provided is:

  • Component Notifications which will absolutely position a notifications panel and accept actions to display.

Props:

  • reduxKey - the root key for this component in the redux store, default 'notifications'.

Actions

NOTIFICATIONS_NOTIFY

Props

  • title : a title for this notification.
  • message : the notification message.
  • messageType : an arbituary type for this message, types are "success", "error", "warning", "info", default "info".
  • duration : the length of time to display this notification in milliseconds, default 5000.
  • clickExpire : user is required to click the notification to expire it, default false.

Usage

import React from 'react';
import {connect} from 'react-redux';
import {Notifications} from 'rdm-notifications';

@connect()
class Example extends React.Component {

  render() {
    return (
      <div>
        <Notifications />
        <div onClick={this.onNotify}><span>Click Me to Notify</span></div>
      </div>
    )
  }
  
  onNotify = evt => this.props.dispatch({
    type: 'NOTIFICATIONS_NOTIFY',
    title: 'Demo',
    message: 'This is a notification',
    messageType: 'success',
    clickExpire: true
  })
}
0.2.0

5 years ago

0.1.0

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago