restrict pixel from auth and mobile

This commit is contained in:
zeppi 2021-07-14 11:04:14 -04:00 committed by jessopb
parent bc4f71ed8c
commit 00146bcbb2
2 changed files with 17 additions and 2 deletions

View file

@ -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);

View file

@ -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') {