diff --git a/.env.defaults b/.env.defaults index 7dcfcfcce..c4e523924 100644 --- a/.env.defaults +++ b/.env.defaults @@ -19,6 +19,7 @@ SITE_NAME=LBRY SITE_DESCRIPTION=Meet LBRY, an open, free, and community-controlled content wonderland. LOGO_TITLE=lbry.tv SIMPLE_SITE=false +SHOW_ADS=true # OG OG_TITLE_SUFFIX=| lbry.tv diff --git a/config.js b/config.js index 4e832532c..1a0e81a0f 100644 --- a/config.js +++ b/config.js @@ -23,6 +23,7 @@ const config = { DEFAULT_LANGUAGE: process.env.DEFAULT_LANGUAGE, AUTO_FOLLOW_CHANNELS: process.env.AUTO_FOLLOW_CHANNELS, SIMPLE_SITE: process.env.SIMPLE_SITE === 'true', + SHOW_ADS: process.env.SHOW_ADS === 'true', PINNED_URI_1: process.env.PINNED_URI_1, PINNED_LABEL_1: process.env.PINNED_LABEL_1, PINNED_URI_2: process.env.PINNED_URI_2, diff --git a/ui/component/channelContent/view.jsx b/ui/component/channelContent/view.jsx index b2a1977be..dcdc04737 100644 --- a/ui/component/channelContent/view.jsx +++ b/ui/component/channelContent/view.jsx @@ -1,4 +1,5 @@ // @flow +import { SHOW_ADS } from 'config'; import * as CS from 'constants/claim_search'; import * as ICONS from 'constants/icons'; import React, { Fragment } from 'react'; @@ -126,7 +127,7 @@ function ChannelContent(props: Props) { defaultOrderBy={CS.ORDER_BY_NEW} pageSize={defaultPageSize} infiniteScroll={defaultInfiniteScroll} - injectedItem={!isAuthenticated && IS_WEB && } + injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && } meta={
{}} className="wunderbar--inline"> diff --git a/ui/component/recommendedContent/view.jsx b/ui/component/recommendedContent/view.jsx index 191572c3a..bda16d9f6 100644 --- a/ui/component/recommendedContent/view.jsx +++ b/ui/component/recommendedContent/view.jsx @@ -1,4 +1,5 @@ // @flow +import { SHOW_ADS } from 'config'; import React from 'react'; import ClaimList from 'component/claimList'; import Ads from 'web/component/ads'; @@ -78,7 +79,7 @@ export default class RecommendedContent extends React.PureComponent { type="small" loading={isSearching} uris={recommendedContent} - injectedItem={!isAuthenticated && IS_WEB && } + injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && } empty={__('No related content found')} /> diff --git a/ui/page/discover/view.jsx b/ui/page/discover/view.jsx index 7f89fc40c..f10381894 100644 --- a/ui/page/discover/view.jsx +++ b/ui/page/discover/view.jsx @@ -1,4 +1,5 @@ // @flow +import { SHOW_ADS } from 'config'; import * as ICONS from 'constants/icons'; import React, { useRef } from 'react'; import Page from 'component/page'; @@ -94,7 +95,7 @@ function DiscoverPage(props: Props) { tags={tags} hiddenNsfwMessage={} repostedClaimId={repostedClaim ? repostedClaim.claim_id : null} - injectedItem={!isAuthenticated && IS_WEB && } + injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && } meta={ tag && !isMobile && ( diff --git a/ui/page/search/view.jsx b/ui/page/search/view.jsx index 08901f632..674ef4e80 100644 --- a/ui/page/search/view.jsx +++ b/ui/page/search/view.jsx @@ -1,5 +1,5 @@ // @flow -import { SIMPLE_SITE } from 'config'; +import { SIMPLE_SITE, SHOW_ADS } from 'config'; import * as ICONS from 'constants/icons'; import * as PAGES from 'constants/pages'; import React, { useEffect, Fragment } from 'react'; @@ -118,7 +118,7 @@ export default function SearchPage(props: Props) { uris={uris} loading={isSearching} header={} - injectedItem={!isAuthenticated && IS_WEB && } + injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && } headerAltControls={ {__('Find what you were looking for?')}