react-share
Advanced tools
Comparing version 1.10.2 to 1.11.0
@@ -0,1 +1,6 @@ | ||
## 1.11.0 (Nov 18, 2016) | ||
* Added `beforeOnClick` option for share buttons | ||
* Added `hashtag` option for Facebook share button | ||
## 1.10.0 (Sep 17, 2016) | ||
@@ -2,0 +7,0 @@ |
@@ -72,11 +72,30 @@ 'use strict'; | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = ShareButton.__proto__ || (0, _getPrototypeOf2.default)(ShareButton)).call.apply(_ref, [this].concat(args))), _this), _this.onClick = function (e) { | ||
if (!_this.props.disabled) { | ||
e.preventDefault(); | ||
var _this$props = _this.props, | ||
disabled = _this$props.disabled, | ||
windowWidth = _this$props.windowWidth, | ||
windowHeight = _this$props.windowHeight, | ||
beforeOnClick = _this$props.beforeOnClick; | ||
var windowOptions = { | ||
height: _this.props.windowHeight, | ||
width: _this.props.windowWidth | ||
}; | ||
(0, _utils.windowOpen)(_this.link(), windowOptions); | ||
if (!disabled) { | ||
(function () { | ||
e.preventDefault(); | ||
var windowOptions = { | ||
height: windowHeight, | ||
width: windowWidth | ||
}; | ||
var windowOpenBound = function windowOpenBound() { | ||
return (0, _utils.windowOpen)(_this.link(), windowOptions); | ||
}; | ||
if (beforeOnClick) { | ||
beforeOnClick().then(function () { | ||
return windowOpenBound(); | ||
}); | ||
} else { | ||
windowOpenBound(); | ||
} | ||
})(); | ||
} | ||
@@ -141,3 +160,4 @@ }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
windowWidth: _react.PropTypes.number, | ||
windowHeight: _react.PropTypes.number | ||
windowHeight: _react.PropTypes.number, | ||
beforeOnClick: _react.PropTypes.func | ||
}; | ||
@@ -178,3 +198,4 @@ ShareButton.defaultProps = { | ||
title: props.title, | ||
picture: props.picture | ||
picture: props.picture, | ||
hashtag: props.hashtag | ||
}; | ||
@@ -184,3 +205,4 @@ }, { | ||
title: _react.PropTypes.string, | ||
picture: _react.PropTypes.string | ||
picture: _react.PropTypes.string, | ||
hashtag: _react.PropTypes.string | ||
}, { | ||
@@ -187,0 +209,0 @@ windowWidth: 550, |
@@ -50,3 +50,4 @@ 'use strict'; | ||
description = _ref2.description, | ||
picture = _ref2.picture; | ||
picture = _ref2.picture, | ||
hashtag = _ref2.hashtag; | ||
@@ -59,3 +60,4 @@ (0, _assert2.default)(url, 'facebook.url'); | ||
description: description, | ||
picture: picture | ||
picture: picture, | ||
hashtag: hashtag | ||
}); | ||
@@ -62,0 +64,0 @@ } |
{ | ||
"name": "react-share", | ||
"version": "1.10.2", | ||
"version": "1.11.0", | ||
"description": "Easy social media share buttons and share counts.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/react-share.js", |
@@ -10,20 +10,4 @@ # react-share | ||
### News | ||
### Features | ||
##### 15.5.2016 | ||
Version 1.6.1 no longer adds `display: 'inline-block'` to icons. If you are | ||
upgrading from an older version, be sure to add the style yourself if needed. | ||
##### 7.5.2016 | ||
`New!` VK support added in version 1.6.0. | ||
##### 23.11.2015 | ||
Since 20th of November Twitter no longer supports open count API. The service | ||
was shut down and there is currently no way to fetch the share count. | ||
Thus, TwitterShareCount was removed in version 1.3.0. | ||
#### Features: | ||
* no external script loading, i.e. no dependencies on SDKs | ||
@@ -86,3 +70,3 @@ * opens a popup share-window | ||
|-------|--------|--------------| | ||
|__All__|__`children`__: A React node (e.g. string or element)<br />__`url`__: URL of the shared page (string)|__`disabled`__: Disables click action and adds `disabled` class (bool)<br/>__`disabledStyle`__: Style when button is disabled (object, default = { opacity: 0.6 })<br/>__`windowWidth`, `windowHeight`__: opened window dimensions (int, different defaults for all share buttons)| | ||
|__All__|__`children`__: A React node (e.g. string or element)<br />__`url`__: URL of the shared page (string)|__`disabled`__: Disables click action and adds `disabled` class (bool)<br/>__`disabledStyle`__: Style when button is disabled (object, default = { opacity: 0.6 })<br/>__`windowWidth`, `windowHeight`__: opened window dimensions (int, different defaults for all share buttons)<br>__`beforeOnClick`__: Takes a function that returns a Promise to be fulfilled before calling onClick| | ||
|FacebookShareButton|-|__`title`__: Title of the shared page (string)<br/>__`description`__: Description of the shared page (string)| | ||
@@ -89,0 +73,0 @@ |GooglePlusShareButton|-|-| |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38165
634
143