Skip to content

Commit

Permalink
Deleted old ad code for Raptive, and added ad placement divs for Raptive
Browse files Browse the repository at this point in the history
  • Loading branch information
Spicer Matthews committed Mar 1, 2024
1 parent ab5c381 commit 065be28
Showing 1 changed file with 28 additions and 86 deletions.
114 changes: 28 additions & 86 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,48 +317,6 @@ const useStyles = makeStyles((theme) => ({
},
}))

// if (isClientSide()) {
// // Load ads immediately on the client side when we parse
// // this file rather than waiting for component mount.
// const loadAds = () => {
// try {
// const setGAMDevKey = isGAMDevEnvironment()

// fetchAds({
// adUnits: Object.values(getAdUnits()),
// pageLevelKeyValues: {
// v4: 'true',
// causeId: localStorageMgr.getCauseForGAM(),
// ...(setGAMDevKey && { dev: 'true' }),
// },
// auctionTimeout: 1000,
// bidderTimeout: 700,
// consent: {
// enabled: true,

// // Time to wait for the consent management platform (CMP) to respond.
// // If the CMP does not respond in this time, ad auctions may be cancelled.
// // The tab-cmp package aims to make the CMP respond much more quickly
// // than this after the user's first page load.
// timeout: 500,
// },
// publisher: {
// pageUrl: getCurrentURL(),
// },
// logLevel: 'error',
// onError: (e) => {
// logger.error(e)
// },
// disableAds: !areAdsEnabled(),
// useMockAds: showMockAds(),
// })
// } catch (e) {
// logger.error(e)
// }
// }
// loadAds()
// }

const getRelayQuery = async ({ AuthUser }) => {
// If the user is not authenticated, don't try to fetch data
// for this page. We won't render the page until data exists.
Expand Down Expand Up @@ -1168,51 +1126,35 @@ const Index = ({ data: fallbackData, userAgent }) => {
</div>
<div className={classes.adsContainer}>
<div className={classes.adsContainerRectangles}>
{adUnits.rectangleAdSecondary && shouldRenderAds ? (
<AdComponent
adId={adUnits.rectangleAdSecondary.adId}
onAdDisplayed={(displayedAdInfo) => {
onAdDisplayed(displayedAdInfo, adContext)
}}
onError={onAdError}
style={{
display: 'flex',
minWidth: 300,
overflow: 'visible',
}}
/>
) : null}
{adUnits.rectangleAdPrimary && shouldRenderAds ? (
<AdComponent
adId={adUnits.rectangleAdPrimary.adId}
onAdDisplayed={(displayedAdInfo) => {
onAdDisplayed(displayedAdInfo, adContext)
}}
onError={onAdError}
style={{
display: 'flex',
minWidth: 300,
overflow: 'visible',
marginTop: 10,
}}
/>
) : null}
<div
id="raptive-content-ad-1"
style={{
display: 'flex',
minWidth: 300,
overflow: 'visible',
}}
/>

<div
id="raptive-content-ad-2"
style={{
display: 'flex',
minWidth: 300,
overflow: 'visible',
marginTop: 10,
}}
/>
</div>

<div className={classes.adContainerLeaderboard}>
<div
id="raptive-content-ad-3"
style={{
overflow: 'visible',
minWidth: 728,
}}
/>
</div>
{adUnits.leaderboard && shouldRenderAds ? (
<div className={classes.adContainerLeaderboard}>
<AdComponent
adId={adUnits.leaderboard.adId}
onAdDisplayed={(displayedAdInfo) => {
onAdDisplayed(displayedAdInfo, adContext)
}}
onError={onAdError}
style={{
overflow: 'visible',
minWidth: 728,
}}
/>
</div>
) : null}
</div>
<div className={classes.groupImpactContainer}>
{(impactType === CAUSE_IMPACT_TYPES.group ||
Expand Down

0 comments on commit 065be28

Please sign in to comment.