From 586b50d130b7b0d226112665ec7caa6ddd29f69f Mon Sep 17 00:00:00 2001 From: son Date: Fri, 29 Oct 2021 14:05:01 +0700 Subject: [PATCH] add facebook page --- package.json | 1 + src/Content/FacebookPage/index.js | 44 +++++++++++++++++++++++++++++++ src/Content/Innercontent.js | 5 +++- yarn.lock | 5 ++++ 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 src/Content/FacebookPage/index.js diff --git a/package.json b/package.json index 7151bec..31d5620 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "react-helmet": "^6.1.0", "react-html-parser": "^2.0.2", "react-lazyload": "^3.2.0", + "react-load-script": "^0.0.6", "react-responsive-carousel": "^3.2.18" }, "presets": [ diff --git a/src/Content/FacebookPage/index.js b/src/Content/FacebookPage/index.js new file mode 100644 index 0000000..7c84907 --- /dev/null +++ b/src/Content/FacebookPage/index.js @@ -0,0 +1,44 @@ +import React, { useState, useEffect, Fragment } from 'react'; +import Script from 'react-load-script'; + +const FacebookPage = props => { + const [scriptLoaded, setScriptLoaded] = useState(false); + + const { pageURL } = props.item.dataParsed; + + console.log(pageURL); + + useEffect(() => { + if (window.FB) { + window.FB.XFBML.parse(); + } + }, []); + + return ( + <> +