// @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'; 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 = ADS_URL; script.async = true; // $FlowFixMe document.body.appendChild(script); return () => { // $FlowFixMe document.body.removeChild(script); // if user navigates too rapidly,