lbry-desktop/web/component/pixel/view.jsx

43 lines
984 B
React
Raw Normal View History

2021-07-14 05:40:49 +02:00
// @flow
import React from 'react';
import { SIMPLE_SITE } from 'config';
2021-07-14 17:04:14 +02:00
import { useIsMobile } from 'effects/use-screensize';
2021-07-14 05:40:49 +02:00
type Props = {
type: string,
2021-07-14 17:04:14 +02:00
isAuthenticated: boolean,
2021-07-14 05:40:49 +02:00
};
const Pixel = (props: Props) => {
2021-07-14 17:04:14 +02:00
const { type, isAuthenticated } = props;
const isMobile = useIsMobile();
// TODO: restrict to country
if (!SIMPLE_SITE || isMobile || isAuthenticated) {
2021-07-14 05:40:49 +02:00
return null;
}
if (type === 'retargeting') {
return (
<>
<img
src="https://ctrack.trafficjunky.net/ctrack?action=list&type=add&id=0&context=Odysee&cookiename=RetargetingPixel&age=44000&maxcookiecount=10"
alt=""
/>
</>
);
} else if (type === 'kill') {
return (
<>
<img
src="https://ctrack.trafficjunky.net/ctrack?action=list&type=add&id=0&context=Odysee&cookiename=KillPixel&age=0&maxcookiecount=10"
alt=""
/>
</>
);
} else {
return null;
}
};
export default Pixel;