Socket
Socket
Sign inDemoInstall

react-redux-toastr

Package Overview
Dependencies
Maintainers
1
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-redux-toastr - npm Package Compare versions

Comparing version 4.3.0 to 4.4.0

2

lib/Button.js

@@ -18,3 +18,3 @@ 'use strict';

return props.onClick();
} },
}, className: props.className },
_react2.default.createElement(

@@ -21,0 +21,0 @@ 'p',

@@ -153,3 +153,4 @@ 'use strict';

okText: 'ok',
cancelText: 'cancel'
cancelText: 'cancel',
disableCancel: false
}

@@ -156,0 +157,0 @@ };

@@ -179,3 +179,3 @@ 'use strict';

},
'x'
'\u2715'
);

@@ -182,0 +182,0 @@ };

@@ -49,3 +49,4 @@ 'use strict';

transitionIn = _confirm$options.transitionIn,
transitionOut = _confirm$options.transitionOut;
transitionOut = _confirm$options.transitionOut,
disableCancel = _confirm$options.disableCancel;

@@ -57,3 +58,3 @@

_this.transitionOut = transitionOut || confirmOptions.transitionOut;
_this.disableCancel = disableCancel != null ? disableCancel : confirmOptions.disableCancel;
(0, _utils._bind)('setTransition removeConfirm handleOnKeyUp handleOnKeyDown', _this);

@@ -152,4 +153,6 @@ _this.isKeyDown = false;

var code = (0, _utils.keyCode)(e);
if (code == ESC) {
if (code == ESC && !this.disableCancel) {
this.handleCancelClick();
} else if (code == ESC && this.disableCancel) {
this.handleConfirmClick();
} else if (code == ENTER && this.isKeyDown) {

@@ -179,6 +182,6 @@ this.isKeyDown = false;

_Button2.default,
{ onClick: this.handleConfirmClick.bind(this) },
{ className: this.disableCancel ? 'full-width' : '', onClick: this.handleConfirmClick.bind(this) },
this.okText
),
_react2.default.createElement(
this.disableCancel ? null : _react2.default.createElement(
_Button2.default,

@@ -185,0 +188,0 @@ { onClick: this.handleCancelClick.bind(this) },

{
"name": "react-redux-toastr",
"version": "4.3.0",
"version": "4.4.0",
"description": "react-redux-toastr is a React toastr message implemented with Redux",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -224,2 +224,15 @@ ##`react-redux-toastr` [demo](http://diegoddox.github.io/react-redux-toastr/)

You can make it so `ok` is the only button by:
- Passing the `disableCancel` prop to the `toasterConfirmOptions` object:
```javascript
const toastrConfirmOptions = {
...
disableCancel: true;
};
toastr.confirm('You have timed out! Please log back in.', toastrConfirmOptions);
```
### Avatar: in case you wanna use the same avatar as the example

@@ -226,0 +239,0 @@ [Avatar](https://github.com/diegoddox/react-redux-toastr/blob/master/development/Avatar.js)

import React from 'react';
const Button = props => (
<button type="button" onClick={() => props.onClick()}>
<button type="button" onClick={() => props.onClick()} className={props.className}>
<p>{props.children}</p>

@@ -6,0 +6,0 @@ </button>

@@ -39,3 +39,4 @@ import React, {Component, PropTypes} from 'react';

okText: 'ok',
cancelText: 'cancel'
cancelText: 'cancel',
disableCancel: false
}

@@ -42,0 +43,0 @@ };

@@ -157,3 +157,3 @@ import CSSCore from 'fbjs/lib/CSSCore';

>
x
&#x2715;
</button>

@@ -160,0 +160,0 @@ );

@@ -21,3 +21,4 @@ import React, {Component, PropTypes} from 'react';

transitionIn,
transitionOut
transitionOut,
disableCancel
} = confirm.options;

@@ -29,3 +30,3 @@

this.transitionOut = transitionOut || confirmOptions.transitionOut;
this.disableCancel = (disableCancel != null) ? disableCancel : confirmOptions.disableCancel;
_bind('setTransition removeConfirm handleOnKeyUp handleOnKeyDown', this);

@@ -117,5 +118,7 @@ this.isKeyDown = false;

const code = keyCode(e);
if (code == ESC) {
if (code == ESC && !this.disableCancel) {
this.handleCancelClick();
} else if (code == ENTER && this.isKeyDown) {
} else if (code == ESC && this.disableCancel) {
this.handleConfirmClick();
} else if ((code == ENTER && this.isKeyDown)) {
this.isKeyDown = false;

@@ -131,8 +134,12 @@ this.handleConfirmClick();

<div className="message">{this.props.confirm.message}</div>
<Button onClick={this.handleConfirmClick.bind(this)}>
{this.okText}
</Button>
<Button onClick={this.handleCancelClick.bind(this)}>
{this.cancelText}
</Button>
<Button className={this.disableCancel ? 'full-width' : ''} onClick={this.handleConfirmClick.bind(this)}>
{this.okText}
</Button>
{
this.disableCancel ? null : (
<Button onClick={this.handleCancelClick.bind(this)}>
{this.cancelText}
</Button>
)
}
</div>

@@ -139,0 +146,0 @@ <div className="shadow"></div>

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc