Created
December 9, 2019 09:59
-
-
Save bllmo/014f334e93b9f3c48cdf74e47c3ca3cf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const Link = props => { | |
var isDevelopment = | |
location.hostname === "localhost" || location.hostname === "127.0.0.1"; | |
return ( | |
<Block | |
position="absolute" | |
height={props.height} | |
width={props.width} | |
top={props.top} | |
bottom={props.bottom} | |
props={{ | |
onClick: function() { | |
var params = window.adsbybeintoo.params; | |
var url = ""; | |
if (params) { | |
url += params.click_url; | |
} | |
url += props.to; | |
try { | |
mraid.open(url); | |
} catch (err) { | |
window.open(url); | |
} | |
}.bind(this) | |
}} | |
backgroundColor={isDevelopment ? "rgba(0, 235, 50, 0.3)" : null} | |
border={isDevelopment ? "4px solid rgba(0, 235, 50, 1)" : null} | |
></Block> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment