diff --git a/lbrytv/component/ads.jsx b/lbrytv/component/ads.jsx index e7162f434..1130a504b 100644 --- a/lbrytv/component/ads.jsx +++ b/lbrytv/component/ads.jsx @@ -1,28 +1,61 @@ +// @flow +import * as PAGES from 'constants/pages'; import React, { useEffect } from 'react'; +import { withRouter } from 'react-router'; +import I18nMessage from 'component/i18nMessage'; +import Button from 'component/button'; -function Extra(props) { - const url = '//assets.revcontent.com/master/delivery.js'; +const ADS_URL = '//assets.revcontent.com/master/delivery.js'; + +type Props = { + location: { pathname: string }, +}; + +function Ads(props: Props) { + const { + location: { pathname }, + } = props; useEffect(() => { const script = document.createElement('script'); - script.src = url; + script.src = ADS_URL; script.async = true; + // $FlowFixMe document.body.appendChild(script); return () => { + // $FlowFixMe document.body.removeChild(script); // if user navigates too rapidly,