Skip to content

Commit 08b5173

Browse files
committed
enabled facebook comments on posts
1 parent 47c662c commit 08b5173

File tree

8 files changed

+69
-5
lines changed

8 files changed

+69
-5
lines changed

example/.env.development

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
DISQUS_SHORTNAME=
2-
FORM_URL=http://localhost:3000/api/project/5e81b8923d8c2d64d8549add/forms
2+
FORM_URL=http://localhost:3000/api/project/5e81b8923d8c2d64d8549add/forms
3+
FB_APP_ID=

example/.env.production

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
DISQUS_SHORTNAME=
2-
FORM_URL=http://localhost:3000/api/project/5e81b8923d8c2d64d8549add/forms
2+
FORM_URL=http://localhost:3000/api/project/5e81b8923d8c2d64d8549add/forms
3+
FB_APP_ID=

example/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"disqus-react": "^1.0.8",
1515
"gatsby": "2.20.24",
1616
"react": "^16.13.0",
17-
"react-dom": "^16.13.0"
17+
"react-dom": "^16.13.0",
18+
"react-facebook": "^8.1.4"
1819
}
1920
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react";
2+
import { FacebookProvider, Comments } from 'react-facebook';
3+
4+
const FbComments = props => {
5+
return process.env.FB_APP_ID ? (
6+
<FacebookProvider appId={process.env.FB_APP_ID}>
7+
<Comments href={props.href}/>
8+
</FacebookProvider>
9+
) : (
10+
<></>
11+
);
12+
return ;
13+
};
14+
15+
export default FbComments;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const FbComments = () => {
2+
return <></>;
3+
};
4+
5+
export default FbComments;

gatsby-wordpress-theme-libre/src/styles/global.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,3 +2134,5 @@ object {
21342134
padding: 3rem;
21352135
}
21362136
}
2137+
2138+
.fb-comments iframe { width: 100% !important; }

gatsby-wordpress-theme-libre/src/templates/post.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Footer from "../components/footer";
66
import ArticleMeta from "../components/meta/article-meta";
77
import SubscribeForm from "../components/subscribe-form";
88
import Disqus from "../components/disqus";
9+
import FbComments from "../components/fb-comments";
910
import facebookShare from "../images/facebook-share.svg";
1011
import twitterShare from "../images/twitter-share.svg";
1112
import linkedInShare from "../images/linkedin.svg";
@@ -272,6 +273,7 @@ const Post = ({ data, location }) => {
272273
</article>
273274

274275
<Disqus />
276+
<FbComments href={href} />
275277
<SubscribeForm />
276278
</main>
277279
</div>

yarn.lock

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,6 +1738,11 @@
17381738
resolved "https://registry.yarnpkg.com/@types/debug/-/debug-0.0.30.tgz#dc1e40f7af3b9c815013a7860e6252f6352a84df"
17391739
integrity sha512-orGL5LXERPYsLov6CWs3Fh6203+dXzJkR7OnddIr2514Hsecwc8xRpzCapshBbKFImCsvS/mk6+FWiN5LyZJAQ==
17401740

1741+
"@types/eslint-visitor-keys@^1.0.0":
1742+
version "1.0.0"
1743+
resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
1744+
integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==
1745+
17411746
"@types/events@*":
17421747
version "3.0.0"
17431748
resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7"
@@ -1913,6 +1918,11 @@
19131918
version "2.30.0"
19141919
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.30.0.tgz#7681c305a6f4341ae2579f5e3a75846c29eee9ce"
19151920
integrity sha512-9kDOxzp0K85UnpmPJqUzdWaCNorYYgk1yZmf4IKzpeTlSAclnFsrLjfwD9mQExctLoLoGAUXq1co+fbr+3HeFw==
1921+
dependencies:
1922+
"@types/eslint-visitor-keys" "^1.0.0"
1923+
"@typescript-eslint/experimental-utils" "2.30.0"
1924+
"@typescript-eslint/typescript-estree" "2.30.0"
1925+
eslint-visitor-keys "^1.1.0"
19161926

19171927
"@typescript-eslint/typescript-estree@2.30.0":
19181928
version "2.30.0"
@@ -3347,6 +3357,11 @@ camelcase@^5.0.0, camelcase@^5.3.1:
33473357
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
33483358
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
33493359

3360+
can-use-dom@^0.1.0:
3361+
version "0.1.0"
3362+
resolved "https://registry.yarnpkg.com/can-use-dom/-/can-use-dom-0.1.0.tgz#22cc4a34a0abc43950f42c6411024a3f6366b45a"
3363+
integrity sha1-IsxKNKCrxDlQ9CxkEQJKP2NmtFo=
3364+
33503365
caniuse-api@^3.0.0:
33513366
version "3.0.0"
33523367
resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-3.0.0.tgz#5e4d90e2274961d46291997df599e3ed008ee4c0"
@@ -11117,7 +11132,7 @@ prompts@^2.3.2:
1111711132
kleur "^3.0.3"
1111811133
sisteransi "^1.0.4"
1111911134

11120-
prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
11135+
prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
1112111136
version "15.7.2"
1112211137
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
1112311138
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
@@ -11405,6 +11420,15 @@ react-error-overlay@^6.0.3:
1140511420
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.6.tgz#ac4d9dc4c1b5c536c2c312bf66aa2b09bfa384e2"
1140611421
integrity sha512-Yzpno3enVzSrSCnnljmr4b/2KUQSMZaPuqmS26t9k4nW7uwJk6STWmH9heNjPuvqUTO3jOSPkHoKgO4+Dw7uIw==
1140711422

11423+
react-facebook@^8.1.4:
11424+
version "8.1.4"
11425+
resolved "https://registry.yarnpkg.com/react-facebook/-/react-facebook-8.1.4.tgz#77703557594be4ef188e33c42a4b2aa9aa9d048c"
11426+
integrity sha512-OVV9+h8jR4Us94ymHyrKpf33WqPX4+3vJvCFEV6ynaW80TC6rucYouQtRSv7G3oW+Tb+qAx8z8DZPYJfIVRW+A==
11427+
dependencies:
11428+
"@babel/runtime" "^7.7.2"
11429+
can-use-dom "^0.1.0"
11430+
react-spinner-children "^1.0.8"
11431+
1140811432
react-fast-compare@^2.0.2:
1140911433
version "2.0.4"
1141011434
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-2.0.4.tgz#e84b4d455b0fec113e0402c329352715196f81f9"
@@ -11471,6 +11495,14 @@ react-side-effect@^1.1.0:
1147111495
dependencies:
1147211496
shallowequal "^1.0.1"
1147311497

11498+
react-spinner-children@^1.0.8:
11499+
version "1.0.8"
11500+
resolved "https://registry.yarnpkg.com/react-spinner-children/-/react-spinner-children-1.0.8.tgz#6fdd6a89593c5f233bb56f4deccb812382e6ca74"
11501+
integrity sha1-b91qiVk8XyM7tW9N7MuBI4LmynQ=
11502+
dependencies:
11503+
prop-types "^15.6.0"
11504+
spin.js "^2.3.2"
11505+
1147411506
react@^16.13.0, react@^16.8.0:
1147511507
version "16.13.0"
1147611508
resolved "https://registry.yarnpkg.com/react/-/react-16.13.0.tgz#d046eabcdf64e457bbeed1e792e235e1b9934cf7"
@@ -12291,7 +12323,7 @@ shallowequal@^1.0.1, shallowequal@^1.1.0:
1229112323
resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8"
1229212324
integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==
1229312325

12294-
sharp@0.23.4, sharp@^0.23.4:
12326+
sharp@^0.23.4:
1229512327
version "0.23.4"
1229612328
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.23.4.tgz#ca36067cb6ff7067fa6c77b01651cb9a890f8eb3"
1229712329
integrity sha512-fJMagt6cT0UDy9XCsgyLi0eiwWWhQRxbwGmqQT6sY8Av4s0SVsT/deg8fobBQCTDU5iXRgz0rAeXoE2LBZ8g+Q==
@@ -12683,6 +12715,11 @@ spdy@^4.0.1:
1268312715
select-hose "^2.0.0"
1268412716
spdy-transport "^3.0.0"
1268512717

12718+
spin.js@^2.3.2:
12719+
version "2.3.2"
12720+
resolved "https://registry.yarnpkg.com/spin.js/-/spin.js-2.3.2.tgz#6caa56d520673450fd5cfbc6971e6d0772c37a1a"
12721+
integrity sha1-bKpW1SBnNFD9XPvGlx5tB3LDeho=
12722+
1268612723
split-string@^3.0.1, split-string@^3.0.2:
1268712724
version "3.1.0"
1268812725
resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2"

0 commit comments

Comments
 (0)