UNPKG

cluedin-widget

Version:

This project contains all the pages needed for browsing entities and searching them. The aim is to replace the CluedIn.Webapp project with this one when all the pages ( including the Admin page ) will be ported to REACT.

35 lines (27 loc) 972 B
import React, { Component } from 'react'; import EntityDefaultHeader from '../entityRelated/EntityDefaultHeader.jsx'; export default class Announcement extends Component { render() { const { entity, openInNewTab } = this.props; let twitterPlaceholder; var tweetId = entity.data.properties['property-twitter.status.tweetid']; if (tweetId) { twitterPlaceholder = <div style={{marginLeft: '110px'}} ref="twitter"></div> } return ( <div className="cluedIn_entity_row"> <EntityDefaultHeader openInNewTab={openInNewTab} entity={entity}></EntityDefaultHeader> {twitterPlaceholder} </div> ); } componentDidMount() { const { entity } = this.props; var tweetId = entity.data.properties['property-twitter.status.tweetid']; if (tweetId && twttr.widgets && this.refs.twitter) { window.twttr.widgets.createTweet(tweetId, this.refs.twitter, { linkColor: '#06979e' }); } } }