diff --git a/.flowconfig b/.flowconfig index 859f16393..c679ae305 100644 --- a/.flowconfig +++ b/.flowconfig @@ -26,6 +26,6 @@ module.name_mapper='^analytics\(.*\)$' -> '/ui/analytics\1' module.name_mapper='^i18n\(.*\)$' -> '/ui/i18n\1' module.name_mapper='^effects\(.*\)$' -> '/ui/effects\1' module.name_mapper='^config\(.*\)$' -> '/config\1' - +module.name_mapper='^lbrytv\/component\(.*\)$' -> '/lbrytv/component\1' [strict] diff --git a/lbrytv/component/ad/index.jsx b/lbrytv/component/ad/index.jsx new file mode 100644 index 000000000..01b62663c --- /dev/null +++ b/lbrytv/component/ad/index.jsx @@ -0,0 +1,33 @@ +import React, { useEffect } from 'react'; + +function Extra(props) { + const url = '//assets.revcontent.com/master/delivery.js'; + + useEffect(() => { + const script = document.createElement('script'); + + script.src = url; + script.async = true; + + document.body.appendChild(script); + + return () => { + document.body.removeChild(script); + // if user navigates too rapidly,