Skip to content

Commit

Permalink
remove analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
KillariDev committed Dec 29, 2023
1 parent b21c79e commit ccf8960
Show file tree
Hide file tree
Showing 107 changed files with 2,209 additions and 4,073 deletions.
59 changes: 0 additions & 59 deletions src/analytics/index.tsx

This file was deleted.

56 changes: 12 additions & 44 deletions src/components/About/AboutFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { BrowserEvent, InterfaceElementName, SharedEventName } from '@uniswap/analytics-events'
import { TraceEvent } from 'analytics'
import { useDisableNFTRoutes } from 'hooks/useDisableNFTRoutes'
import styled from 'styled-components'
import { BREAKPOINTS } from 'theme'
Expand Down Expand Up @@ -120,15 +118,9 @@ const LogoSectionContent = () => {
<SocialLink href="https://discord.gg/FCfyBSbCU5" target="_blank" rel="noopener noreferrer">
<DiscordIcon size={32} />
</SocialLink>
<TraceEvent
events={[BrowserEvent.onClick]}
name={SharedEventName.ELEMENT_CLICKED}
element={InterfaceElementName.TWITTER_LINK}
>
<SocialLink href="https://twitter.com/uniswap" target="_blank" rel="noopener noreferrer">
<TwitterIcon size={32} />
</SocialLink>
</TraceEvent>
<SocialLink href="https://twitter.com/uniswap" target="_blank" rel="noopener noreferrer">
<TwitterIcon size={32} />
</SocialLink>
<SocialLink href="https://github.com/Uniswap" target="_blank" rel="noopener noreferrer">
<GithubIcon size={32} />
</SocialLink>
Expand Down Expand Up @@ -162,43 +154,19 @@ export const AboutFooter = () => {
</LinkGroup>
<LinkGroup>
<LinkGroupTitle>Company</LinkGroupTitle>
<TraceEvent
events={[BrowserEvent.onClick]}
name={SharedEventName.ELEMENT_CLICKED}
element={InterfaceElementName.CAREERS_LINK}
>
<ExternalTextLink href="https://boards.greenhouse.io/uniswaplabs">Careers</ExternalTextLink>
</TraceEvent>
<TraceEvent
events={[BrowserEvent.onClick]}
name={SharedEventName.ELEMENT_CLICKED}
element={InterfaceElementName.BLOG_LINK}
>
<ExternalTextLink href="https://uniswap.org/blog">Blog</ExternalTextLink>
</TraceEvent>
<ExternalTextLink href="https://boards.greenhouse.io/uniswaplabs">Careers</ExternalTextLink>
<ExternalTextLink href="https://uniswap.org/blog">Blog</ExternalTextLink>
</LinkGroup>
<LinkGroup>
<LinkGroupTitle>Get Help</LinkGroupTitle>
<TraceEvent
events={[BrowserEvent.onClick]}
name={SharedEventName.ELEMENT_CLICKED}
element={InterfaceElementName.SUPPORT_LINK}
>
<ExternalTextLink
href="https://support.uniswap.org/hc/en-us/requests/new"
target="_blank"
rel="noopener noreferrer"
>
Contact Us
</ExternalTextLink>
</TraceEvent>
<TraceEvent
events={[BrowserEvent.onClick]}
name={SharedEventName.ELEMENT_CLICKED}
element={InterfaceElementName.SUPPORT_LINK}
<ExternalTextLink
href="https://support.uniswap.org/hc/en-us/requests/new"
target="_blank"
rel="noopener noreferrer"
>
<ExternalTextLink href="https://support.uniswap.org/hc/en-us">Help Center</ExternalTextLink>
</TraceEvent>
Contact Us
</ExternalTextLink>
<ExternalTextLink href="https://support.uniswap.org/hc/en-us">Help Center</ExternalTextLink>
</LinkGroup>
</FooterLinks>

Expand Down
44 changes: 19 additions & 25 deletions src/components/About/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { BrowserEvent, SharedEventName } from '@uniswap/analytics-events'
import { TraceEvent } from 'analytics'
import { Link } from 'react-router-dom'
import styled, { DefaultTheme } from 'styled-components'
import { BREAKPOINTS } from 'theme'
Expand Down Expand Up @@ -106,7 +104,6 @@ const Card = ({
external,
backgroundImgSrc,
icon,
elementName,
}: {
type?: CardType
title: string
Expand All @@ -116,31 +113,28 @@ const Card = ({
external?: boolean
backgroundImgSrc?: string
icon?: React.ReactNode
elementName?: string
}) => {
const isDarkMode = useIsDarkMode()
return (
<TraceEvent events={[BrowserEvent.onClick]} name={SharedEventName.ELEMENT_CLICKED} element={elementName}>
<StyledCard
as={external ? 'a' : Link}
to={external ? undefined : to}
href={external ? to : undefined}
target={external ? '_blank' : undefined}
rel={external ? 'noopenener noreferrer' : undefined}
$backgroundImgSrc={backgroundImgSrc}
$isDarkMode={isDarkMode}
$type={type}
>
<TitleRow>
<CardTitle>{title}</CardTitle>
{icon}
</TitleRow>
<CardDescription type={type}>
{description}
<CardCTA type={type}>{cta}</CardCTA>
</CardDescription>
</StyledCard>
</TraceEvent>
<StyledCard
as={external ? 'a' : Link}
to={external ? undefined : to}
href={external ? to : undefined}
target={external ? '_blank' : undefined}
rel={external ? 'noopenener noreferrer' : undefined}
$backgroundImgSrc={backgroundImgSrc}
$isDarkMode={isDarkMode}
$type={type}
>
<TitleRow>
<CardTitle>{title}</CardTitle>
{icon}
</TitleRow>
<CardDescription type={type}>
{description}
<CardCTA type={type}>{cta}</CardCTA>
</CardDescription>
</StyledCard>
)
}

Expand Down
6 changes: 0 additions & 6 deletions src/components/About/constants.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { InterfaceElementName } from '@uniswap/analytics-events'
import { DollarSign, Terminal } from 'react-feather'
import styled from 'styled-components'
import { lightTheme } from 'theme/colors'
Expand All @@ -18,7 +17,6 @@ export const MAIN_CARDS = [
cta: 'Trade Tokens',
darkBackgroundImgSrc: swapCardImgSrc,
lightBackgroundImgSrc: swapCardImgSrc,
elementName: InterfaceElementName.ABOUT_PAGE_SWAP_CARD,
},
{
to: '/nfts',
Expand All @@ -27,7 +25,6 @@ export const MAIN_CARDS = [
cta: 'Explore NFTs',
darkBackgroundImgSrc: nftCardImgSrc,
lightBackgroundImgSrc: nftCardImgSrc,
elementName: InterfaceElementName.ABOUT_PAGE_NFTS_CARD,
},
]

Expand All @@ -47,7 +44,6 @@ export const MORE_CARDS = [
lightIcon: <DollarSign color={lightTheme.neutral3} size={48} />,
darkIcon: <StyledCardLogo src={darkDollarImgSrc} alt="Earn" />,
cta: 'Buy now',
elementName: InterfaceElementName.ABOUT_PAGE_BUY_CRYPTO_CARD,
},
{
to: '/pools',
Expand All @@ -56,7 +52,6 @@ export const MORE_CARDS = [
lightIcon: <StyledCardLogo src={lightArrowImgSrc} alt="Analytics" />,
darkIcon: <StyledCardLogo src={darkArrowImgSrc} alt="Analytics" />,
cta: 'Provide liquidity',
elementName: InterfaceElementName.ABOUT_PAGE_EARN_CARD,
},
{
to: 'https://docs.uniswap.org',
Expand All @@ -66,6 +61,5 @@ export const MORE_CARDS = [
lightIcon: <Terminal color={lightTheme.neutral3} size={48} />,
darkIcon: <StyledCardLogo src={darkTerminalImgSrc} alt="Developers" />,
cta: 'Developer docs',
elementName: InterfaceElementName.ABOUT_PAGE_DEV_DOCS_CARD,
},
]
18 changes: 0 additions & 18 deletions src/components/AccountDrawer/AnalyticsToggle.tsx

This file was deleted.

25 changes: 8 additions & 17 deletions src/components/AccountDrawer/AuthenticatedHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Trans } from '@lingui/macro'
import { BrowserEvent, InterfaceElementName, InterfaceEventName, SharedEventName } from '@uniswap/analytics-events'
import { CurrencyAmount, Token } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core'
import { sendAnalyticsEvent, TraceEvent } from 'analytics'
import { ButtonEmphasis, ButtonSize, LoadingButtonSpinner, ThemeButton } from 'components/Button'
import Column from 'components/Column'
import { Power } from 'components/Icons/Power'
Expand Down Expand Up @@ -192,7 +190,6 @@ export default function AuthenticatedHeader({ account, openSettings }: { account
const openFiatOnrampModal = useOpenModal(ApplicationModal.FIAT_ONRAMP)
const openFoRModalWithAnalytics = useCallback(() => {
toggleWalletDrawer()
sendAnalyticsEvent(InterfaceEventName.FIAT_ONRAMP_WIDGET_OPENED)
openFiatOnrampModal()
}, [openFiatOnrampModal, toggleWalletDrawer])

Expand Down Expand Up @@ -251,20 +248,14 @@ export default function AuthenticatedHeader({ account, openSettings }: { account
onClick={openSettings}
Icon={Settings}
/>
<TraceEvent
events={[BrowserEvent.onClick]}
name={SharedEventName.ELEMENT_CLICKED}
element={InterfaceElementName.DISCONNECT_WALLET_BUTTON}
>
<IconWithConfirmTextButton
data-testid="wallet-disconnect"
onConfirm={disconnect}
onShowConfirm={setShowDisconnectConfirm}
Icon={Power}
text="Disconnect"
dismissOnHoverOut
/>
</TraceEvent>
<IconWithConfirmTextButton
data-testid="wallet-disconnect"
onConfirm={disconnect}
onShowConfirm={setShowDisconnectConfirm}
Icon={Power}
text="Disconnect"
dismissOnHoverOut
/>
</IconContainer>
</HeaderWrapper>
<PortfolioDrawerContainer>
Expand Down
15 changes: 3 additions & 12 deletions src/components/AccountDrawer/DownloadButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { InterfaceElementName } from '@uniswap/analytics-events'
import { PropsWithChildren, useCallback } from 'react'
import styled from 'styled-components'
import { ClickableStyle } from 'theme/components'
Expand Down Expand Up @@ -32,20 +31,12 @@ function BaseButton({ onClick, branded, children }: PropsWithChildren<{ onClick?
}

// Launches App Store if on an iOS device, else navigates to Uniswap Wallet microsite
export function DownloadButton({
onClick,
text = 'Download',
element,
}: {
onClick?: () => void
text?: string
element: InterfaceElementName
}) {
export function DownloadButton({ onClick, text = 'Download' }: { onClick?: () => void; text?: string }) {
const onButtonClick = useCallback(() => {
// handles any actions required by the parent, i.e. cancelling wallet connection attempt or dismissing an ad
onClick?.()
openDownloadApp({ element })
}, [element, onClick])
openDownloadApp()
}, [onClick])

return (
<BaseButton branded onClick={onButtonClick}>
Expand Down
Loading

0 comments on commit ccf8960

Please sign in to comment.