restrict pixel from auth and mobile
This commit is contained in:
parent
bc4f71ed8c
commit
00146bcbb2
2 changed files with 17 additions and 2 deletions
9
web/component/pixel/index.js
Normal file
9
web/component/pixel/index.js
Normal 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);
|
|
@ -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') {
|
Loading…
Reference in a new issue