Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/AppLayout/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useDispatch } from 'react-redux'

import List, { ListItemType, StyledListItem, StyledListItemText } from 'src/components/List'
import SafeHeader from './SafeHeader'
import { IS_PRODUCTION } from 'src/utils/constants'
import { IS_PRODUCTION, BEAMER_ID } from 'src/utils/constants'
import { wrapInSuspense } from 'src/utils/wrapInSuspense'
import ListIcon from 'src/components/List/ListIcon'
import { openCookieBanner } from 'src/logic/cookies/store/actions/openCookieBanner'
Expand Down Expand Up @@ -124,7 +124,7 @@ const Sidebar = ({
<StyledDivider />

<HelpList>
{!isDesktop && (
{!isDesktop && BEAMER_ID && (
<StyledListItem id="whats-new-button" button onClick={handleClick}>
<ListIcon type="gift" />
<StyledListItemText>What&apos;s new</StyledListItemText>
Expand Down
9 changes: 2 additions & 7 deletions src/utils/beamer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BEAMER_ID } from './constants'
import { BeamerConfig } from 'src/types/Beamer'
import { removeCookies } from 'src/logic/cookies/utils'
import local from './storage/local'

Expand All @@ -17,21 +16,17 @@ export const BEAMER_LS_RE = /^_BEAMER_/

const BEAMER_URL = 'https://app.getbeamer.com/js/beamer-embed.js'

const baseConfig: BeamerConfig = {
product_id: BEAMER_ID,
}

// Beamer script tag singleton
let scriptRef: HTMLScriptElement | null = null

export const loadBeamer = async (): Promise<void> => {
if (!BEAMER_ID) {
console.error('[Beamer] - In order to use Beamer you need to add an appID')
console.warn('[Beamer] - In order to use Beamer you need to add an appID')
return
}

window.beamer_config = {
...baseConfig,
product_id: BEAMER_ID,
selector: 'whats-new-button',
display: 'left',
button: false,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const DEFAULT_CHAIN_ID =
export const PUBLIC_URL = process.env.PUBLIC_URL
export const TX_SERVICE_VERSION = '1'
export const INTERCOM_ID = IS_PRODUCTION ? process.env.REACT_APP_INTERCOM_ID : 'plssl1fl'
export const BEAMER_ID = IS_PRODUCTION ? process.env.REACT_APP_BEAMER_ID || 'ehlRMhQi41258' : 'ehlRMhQi41258'
export const BEAMER_ID = IS_PRODUCTION ? process.env.REACT_APP_BEAMER_ID : 'ehlRMhQi41258'
export const GOOGLE_ANALYTICS_ID = process.env.REACT_APP_GOOGLE_ANALYTICS || ''
export const SENTRY_DSN = process.env.REACT_APP_SENTRY_DSN || ''
export const PORTIS_ID = process.env.REACT_APP_PORTIS_ID ?? '852b763d-f28b-4463-80cb-846d7ec5806b'
Expand Down