diff --git a/web/component/pixel/index.js b/web/component/pixel/index.js new file mode 100644 index 000000000..ae39ece09 --- /dev/null +++ b/web/component/pixel/index.js @@ -0,0 +1,9 @@ +import { connect } from 'react-redux'; +import { selectUserVerifiedEmail } from 'redux/selectors/user'; +import Pixel from './view'; + +const select = (state) => ({ + isAuthenticated: Boolean(selectUserVerifiedEmail(state)), +}); + +export default connect(select)(Pixel); diff --git a/web/component/pixel.jsx b/web/component/pixel/view.jsx similarity index 75% rename from web/component/pixel.jsx rename to web/component/pixel/view.jsx index 697e378d3..d073ca9c7 100644 --- a/web/component/pixel.jsx +++ b/web/component/pixel/view.jsx @@ -1,13 +1,19 @@ // @flow import React from 'react'; import { SIMPLE_SITE } from 'config'; +import { useIsMobile } from 'effects/use-screensize'; + type Props = { type: string, + isAuthenticated: boolean, }; const Pixel = (props: Props) => { - const { type } = props; - if (!SIMPLE_SITE) { + const { type, isAuthenticated } = props; + const isMobile = useIsMobile(); + + // TODO: restrict to country + if (!SIMPLE_SITE || isMobile || isAuthenticated) { return null; } if (type === 'retargeting') {