From b4564c6f46bcc7c59a924da51d5c44d464fc4a1c Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 24 Jan 2020 13:31:49 -0500 Subject: [PATCH] add message to ads about signing in --- lbrytv/component/ads.jsx | 45 ++++++++++++++++++++++++---- ui/component/sideNavigation/view.jsx | 22 +++++++++----- ui/scss/all.scss | 1 + ui/scss/component/_ads.scss | 9 ++++++ ui/scss/component/_navigation.scss | 12 -------- 5 files changed, 63 insertions(+), 26 deletions(-) create mode 100644 ui/scss/component/_ads.scss 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,