Created
December 9, 2019 10:10
-
-
Save bllmo/d40b92d281489b434e48d5751e3d603f 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 Img = props => { | |
var isDevelopment = | |
location.hostname === "localhost" || location.hostname === "127.0.0.1"; | |
var params = window.adsbybeintoo.params; | |
var src = props.src; | |
if (!isDevelopment && params) { | |
var filename = /([\w-]+\.jpg|png|)/.exec(src)[1]; | |
src = | |
"https://s3.eu-west-3.amazonaws.com/fast.beintoo.net/static/" + | |
params.ad_id + | |
"/" + | |
filename; | |
} | |
return ( | |
<Block | |
component="image" | |
top={props.top} | |
bottom={props.bottom} | |
props={{ | |
src: src | |
}} | |
width="100%" | |
position="absolute" | |
/> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment