Skip to content

Commit

Permalink
Removed override stuff for optin video
Browse files Browse the repository at this point in the history
  • Loading branch information
Spicer Matthews committed Aug 22, 2024
1 parent 38c25c4 commit 6fe2834
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 31 deletions.
17 changes: 1 addition & 16 deletions src/components/optinvideo/OptInVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,6 @@ import Modal from '@material-ui/core/Modal'
import IconButton from '@material-ui/core/IconButton'
import CloseIcon from '@material-ui/icons/Close'

const isBrowser = typeof window !== 'undefined'

const sParams = {
NotificationOverride: null,
}

if (isBrowser) {
// eslint-disable-next-line no-undef
const p = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams, prop) => searchParams.get(prop),
})

sParams.NotificationOverride = p['opt-in-override'] || ''
}

// Example Overrides: ?opt-in-override={any user id}
const OptInVideo = ({ user }) => {
const [showModal, setShowModal] = useState(false)
Expand Down Expand Up @@ -115,7 +100,7 @@ const OptInVideo = ({ user }) => {
>
<iframe
id="optin-video-modal-iframe"
src={`${process.env.NEXT_PUBLIC_API_ENDPOINT}/v5/iframe/opt-in-video?user_id=${user.userId}&override=${sParams.NotificationOverride}`}
src={`${process.env.NEXT_PUBLIC_API_ENDPOINT}/v5/iframe/opt-in-video?user_id=${user.userId}`}
title="optin-video-modal-iframe"
style={{
border: 'none',
Expand Down
36 changes: 21 additions & 15 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ import GroupImpactContainer from 'src/components/groupImpactComponents/GroupImpa
import ShopFullPage from 'src/components/promos/ShopFullPage'
import SearchFullPage from 'src/components/promos/SearchFullPage'
import Notification from 'src/components/notification/Notification'
import OptInVideo from 'src/components/optinvideo/OptInVideo'

// import NotificationOld from 'src/components/Notification'

Expand All @@ -108,8 +109,6 @@ import FrontpageShortcutListContainer from 'src/components/FrontpageShortcutList
import Modal from '@material-ui/core/Modal'
import { Box } from '@material-ui/core'

const isBrowser = typeof window !== 'undefined'

const getNotifDismissKey = (code) => `${NOTIF_DISMISS_PREFIX}.${code}`

const useStyles = makeStyles((theme) => ({
Expand Down Expand Up @@ -772,19 +771,6 @@ const Index = ({ data: fallbackData, userAgent }) => {
setShowLeaderboardFunc(true)
}

const sParams = {
OptInOverride: null,
}

if (isBrowser) {
// eslint-disable-next-line no-undef
const p = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams, prop) => searchParams.get(prop),
})

sParams.OptInOverride = p['opt-in-override'] || ''
}

return (
<>
<Head>
Expand Down Expand Up @@ -875,6 +861,26 @@ const Index = ({ data: fallbackData, userAgent }) => {
</a>
)}

{user && (
<>
<iframe
title="opt-in-video"
frameBorder="0"
allowtransparency="true"
src={`${process.env.NEXT_PUBLIC_API_ENDPOINT}/v5/iframe/opt-in-video?show=icon&user_id=${user.userId}`}
style={{
height: 40,
width: 40,
border: 'none',
marginRight: 10,
backgroundColor: 'transparent',
}}
/>

<OptInVideo user={user} />
</>
)}

{user && (
<IconButton
style={{
Expand Down

0 comments on commit 6fe2834

Please sign in to comment.