@quintype/components 3.0.2-image-alt.1 → 3.0.3-nl-fb-share-bug.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -3309,9 +3309,10 @@ var SocialShareBase = /*#__PURE__*/function (_React$Component) {
3309
3309
  key: "render",
3310
3310
  value: function render() {
3311
3311
  var fullUrl = this.props.fullUrl || "".concat(this.props.publisherUrl, "/").concat(this.props.url);
3312
- var hashtags = this.props.hashtags ? this.props.hashtags : '';
3312
+ var hashtags = this.props.hashtags ? this.props.hashtags : "";
3313
+ console.log("Full Url is --->", this.props.app_id, "props --->", this.props);
3313
3314
  return /*#__PURE__*/React__default["default"].createElement(this.props.template, Object.assign({
3314
- fbUrl: "https://www.facebook.com/sharer.php?u=".concat(encodeURIComponent(fullUrl)),
3315
+ fbUrl: "https://www.facebook.com/dialog/share?app_id=".concat(this.props.app_id, "&href=").concat(encodeURIComponent(fullUrl), "redirect_uri=").concat(encodeURIComponent(fullUrl)),
3315
3316
  twitterUrl: "https://twitter.com/intent/tweet?url=".concat(encodeURIComponent(fullUrl), "&text=").concat(encodeURIComponent(this.props.title), "&hashtags=").concat(hashtags),
3316
3317
  gplusUrl: "https://plus.google.com/share?url=".concat(encodeURIComponent(fullUrl)),
3317
3318
  linkedinUrl: "https://www.linkedin.com/shareArticle?url=".concat(encodeURIComponent(fullUrl), "&title=").concat(encodeURIComponent(this.props.title)),
@@ -3340,17 +3341,17 @@ function mapStateToProps$3(state) {
3340
3341
  * class CustomComponent extends React.Component {
3341
3342
  * getSocialCardsTemplate({fbUrl, twitterUrl, gplusUrl, linkedinUrl, handleNativeShare}) {
3342
3343
  * return <ul className="social-share-icons">
3343
- * <li className="social-share-icon">
3344
- * <a href={fbUrl} target="_blank">
3345
- * <img src={fbIcon} alt="fb icon"/>
3346
- * </a>
3347
- * </li>
3348
- * {handleNativeShare && <li className="social-share-icon">
3349
- * <button onClick={handleNativeShare}>
3350
- * <img src={fbIcon} alt="share icon"/>
3351
- * </button>
3352
- * </li>}
3353
- * </ul>
3344
+ * <li className="social-share-icon">
3345
+ * <a href={fbUrl} target="_blank">
3346
+ * <img src={fbIcon} alt="fb icon"/>
3347
+ * </a>
3348
+ * </li>
3349
+ * {handleNativeShare && <li className="social-share-icon">
3350
+ * <button onClick={handleNativeShare}>
3351
+ * <img src={fbIcon} alt="share icon"/>
3352
+ * </button>
3353
+ * </li>}
3354
+ * </ul>
3354
3355
  * }
3355
3356
  *
3356
3357
  * render() {
@@ -10,7 +10,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
10
10
 
11
11
  import React from "react";
12
12
  import { connect } from "react-redux";
13
- import { withError } from './with-error';
13
+ import { withError } from "./with-error";
14
14
 
15
15
  function getNativeShareHandler(canNativeShare, title, fullUrl) {
16
16
  if (!canNativeShare) {
@@ -53,9 +53,10 @@ var SocialShareBase = /*#__PURE__*/function (_React$Component) {
53
53
  key: "render",
54
54
  value: function render() {
55
55
  var fullUrl = this.props.fullUrl || "".concat(this.props.publisherUrl, "/").concat(this.props.url);
56
- var hashtags = this.props.hashtags ? this.props.hashtags : '';
56
+ var hashtags = this.props.hashtags ? this.props.hashtags : "";
57
+ console.log("Full Url is --->", this.props.app_id, "props --->", this.props);
57
58
  return /*#__PURE__*/React.createElement(this.props.template, Object.assign({
58
- fbUrl: "https://www.facebook.com/sharer.php?u=".concat(encodeURIComponent(fullUrl)),
59
+ fbUrl: "https://www.facebook.com/dialog/share?app_id=".concat(this.props.app_id, "&href=").concat(encodeURIComponent(fullUrl), "redirect_uri=").concat(encodeURIComponent(fullUrl)),
59
60
  twitterUrl: "https://twitter.com/intent/tweet?url=".concat(encodeURIComponent(fullUrl), "&text=").concat(encodeURIComponent(this.props.title), "&hashtags=").concat(hashtags),
60
61
  gplusUrl: "https://plus.google.com/share?url=".concat(encodeURIComponent(fullUrl)),
61
62
  linkedinUrl: "https://www.linkedin.com/shareArticle?url=".concat(encodeURIComponent(fullUrl), "&title=").concat(encodeURIComponent(this.props.title)),
@@ -84,17 +85,17 @@ function mapStateToProps(state) {
84
85
  * class CustomComponent extends React.Component {
85
86
  * getSocialCardsTemplate({fbUrl, twitterUrl, gplusUrl, linkedinUrl, handleNativeShare}) {
86
87
  * return <ul className="social-share-icons">
87
- * <li className="social-share-icon">
88
- * <a href={fbUrl} target="_blank">
89
- * <img src={fbIcon} alt="fb icon"/>
90
- * </a>
91
- * </li>
92
- * {handleNativeShare && <li className="social-share-icon">
93
- * <button onClick={handleNativeShare}>
94
- * <img src={fbIcon} alt="share icon"/>
95
- * </button>
96
- * </li>}
97
- * </ul>
88
+ * <li className="social-share-icon">
89
+ * <a href={fbUrl} target="_blank">
90
+ * <img src={fbIcon} alt="fb icon"/>
91
+ * </a>
92
+ * </li>
93
+ * {handleNativeShare && <li className="social-share-icon">
94
+ * <button onClick={handleNativeShare}>
95
+ * <img src={fbIcon} alt="share icon"/>
96
+ * </button>
97
+ * </li>}
98
+ * </ul>
98
99
  * }
99
100
  *
100
101
  * render() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/components",
3
- "version": "3.0.2-image-alt.1",
3
+ "version": "3.0.3-nl-fb-share-bug.0",
4
4
  "description": "Components to help build Quintype Node.js apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",
@@ -103,7 +103,7 @@
103
103
  "docs": "rimraf docs && jsdoc -c jsdoc.json",
104
104
  "prepack": "npm run build",
105
105
  "prepublishOnly": "./bin-dev-scripts/standard-version-release.sh",
106
- "sync-files-to": "npx onchange --verbose --wait --await-write-finish 'src/**/*' -- ./bin-dev-scripts/sync-to.sh",
106
+ "sync-files-to": "npx onchange --verbose --await-write-finish=2000 'src/**/*' -- ./bin-dev-scripts/sync-to.sh",
107
107
  "test": "jest --config jest.config.js",
108
108
  "test:cover": "jest --coverage --watchAll; open coverage/index.html"
109
109
  }