-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Novo componente para bloco de anúncios
- Loading branch information
1 parent
81d4aa2
commit 416646f
Showing
7 changed files
with
158 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import PropTypes from 'prop-types' | ||
import React from 'react' | ||
import Block from '../Block' | ||
|
||
const AdBlock = ({content}) => { | ||
let gpt_mobile_class = content["gpt-mobile-status"] === "true" ? `ads-block mobile-on` : `ads-block mobile-off` | ||
let gpt_desktop_class = content["gpt-desktop-status"] === "true" ? `ads-block desktop-on` : `ads-block desktop-off` | ||
|
||
React.useEffect(() => { | ||
window.googletag.cmd.push(() => googletag.display(content["gpt-mobile-code"])) | ||
window.googletag.cmd.push(() => googletag.display(content["gpt-desktop-code"])) | ||
}, []); | ||
|
||
return ( | ||
<Block align="center" custom="blocks-ads" mb="6" mt="2"> | ||
<Block custom={gpt_mobile_class}> | ||
<div id={content["gpt-mobile-code"]}></div> | ||
</Block> | ||
<Block custom={gpt_desktop_class}> | ||
<div id={content["gpt-desktop-code"]}></div> | ||
</Block> | ||
</Block> | ||
) | ||
} | ||
AdBlock.propTypes = { | ||
content: PropTypes.object | ||
} | ||
export default AdBlock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@use '../../styles' as *; | ||
|
||
.ads-block { | ||
&.mobile-on {} | ||
&.mobile-off { | ||
display: none; | ||
} | ||
&.desktop-on {} | ||
&.desktop-off { | ||
display: none; | ||
} | ||
@media(max-width: $lg) { | ||
&.mobile-on { | ||
display: flex; | ||
} | ||
&.desktop-on { | ||
display: none; | ||
} | ||
} | ||
@media(min-width: $lg) { | ||
&.mobile-on { | ||
display: none; | ||
} | ||
&.desktop-on { | ||
display: flex; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters