rdm-dialogue

0.0.2 • Public • Published

Dialogue module for "redux dyanmic modules" enabled projects.

Provided is:

  • A dialogue/pop up with alert (default) and confirm capabilities

Props:

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

Actions

OPEN_DIALOGUE

Props

  • message: - a message for the dialogue
  • title: - a title for the dialgogue
  • confirm - the dialogue is a confirm modal, default false.
  • onConfirm - action to dispatch when user confirms the dialogue, default 'RDM_DIALOGUE_CONFIRM'
  • onCancel - action to dispatch when the user cancels the dialogue, default 'RDM_DIALOGUE_CANCEL'
  • confirmLabel - the label for the confirm button
  • cancelLabel - the label for the cancel button
  • transitionTime - the fadein/fadeout duration (in milliseconds), default 250

Usage

import React from 'react';
import {connect} from 'react-redux';
import {Dialogue} from 'rdm-dialogue';

@connect()
class Example extends React.Component {

  render() {
    return (
      <div>
        <Dialgoue />
        <div onClick={this.onNotify}><span>Click Me to Open</span></div>
      </div>
    )
  }
  
  onNotify = evt => this.props.dispatch({
    type: 'RDM_OPEN_DIALOGUE',
    message: 'This is a notification'
  })
}

Readme

Keywords

none

Package Sidebar

Install

npm i rdm-dialogue

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

280 kB

Total Files

25

Last publish

Collaborators

  • verikono