Giveth / Website-3.0

The Giveth website written in React
http://www.giveth.io
2 stars 1 forks source link

Social Network Timelines #5

Open sebastienrohan opened 7 years ago

sebastienrohan commented 7 years ago

I have tried these React plugins to publish the Facebook and Twitter timelines but couldn't get them to work :

No luck either with: https://publish.twitter.com/#

sebastienrohan commented 7 years ago

I think it is the same problem as the Dapp integration : I add the script to the page with : componentDidMount() { const script = document.createElement('script'); script.src = 'bundle.js'; document.body.appendChild(script); } but it doesn't execute. I suppose this is a common situation, how can I make it work ?

sebastienrohan commented 7 years ago

I tried to load the scripts with

  componentDidMount() {
    // load twitter widget
    $script('//platform.twitter.com/widgets.js', function () {
      // inject widget into DOM element
      twttr.widgets.load(
        document.getElementById('twitter')
      );
    });
    // load facebook plugin
    document.addEventListener('fb_init', e => FB.XFBML.parse());
  }

but it still doesn't work.