Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
23 changes: 13 additions & 10 deletions apps/cow-fi/app/(main)/cow-swap/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client'

import type { ReactNode } from 'react'
import { useEffect, useRef } from 'react'

import { useCowAnalytics } from '@cowprotocol/analytics'
Expand All @@ -10,10 +11,13 @@ import IMG_ICON_UNICORN from '@cowprotocol/assets/images/icon-unicorn.svg'
import IMG_COWSWAP_HERO from '@cowprotocol/assets/images/image-cowswap-hero.svg'
import { Color, ProductLogo, ProductVariant, UI } from '@cowprotocol/ui'

import { CowFiCategory } from 'src/common/analytics/types'

import FAQ from '@/components/FAQ'
import LazyLoadTweet from '@/components/LazyLoadTweet'
import LazySVG from '@/components/LazySVG'
import { Link, LinkType } from '@/components/Link'
import { COW_SWAP_CTA } from '@/const/cta'
import { ADVANCED_ORDER_TYPES, BETTER_UX, COW_IS_DIFFERENT, FAQ_DATA, TWEETS } from '@/data/cow-swap/const'
import {
ContainerCard,
Expand All @@ -38,9 +42,8 @@ import {
TopicList,
TopicTitle,
} from '@/styles/styled'
import { CowFiCategory } from 'src/common/analytics/types'

export default function Page() {
export default function Page(): ReactNode {
const analytics = useCowAnalytics()
const tweetSectionRef = useRef<HTMLDivElement>(null)

Expand Down Expand Up @@ -82,18 +85,18 @@ export default function Page() {
<Link
bgColor={`var(${UI.COLOR_BLUE_900_PRIMARY})`}
color={`var(${UI.COLOR_BLUE_300_PRIMARY})`}
href="https://swap.cow.fi/"
href={COW_SWAP_CTA.href}
external
linkType={LinkType.HeroButton}
utmContent="cow-swap-launch-app-button"
utmContent={COW_SWAP_CTA.utmContent}
onClick={() =>
analytics.sendEvent({
category: CowFiCategory.COWSWAP,
action: 'click-launch-app',
action: COW_SWAP_CTA.action,
})
}
>
Launch app
{COW_SWAP_CTA.text}
</Link>
</HeroContent>
<HeroImage width={470} height={470} color={`var(${UI.COLOR_BLUE_900_PRIMARY})`} marginMobile="24px auto 56px">
Expand Down Expand Up @@ -416,18 +419,18 @@ export default function Page() {
<Link
bgColor={`var(${UI.COLOR_BLUE_300_PRIMARY})`}
color={`var(${UI.COLOR_BLUE_900_PRIMARY})`}
href="https://swap.cow.fi/"
href={COW_SWAP_CTA.href}
external
linkType={LinkType.SectionTitleButton}
utmContent="cow-swap-launch-app-button"
utmContent={COW_SWAP_CTA.utmContent}
onClick={() =>
analytics.sendEvent({
category: CowFiCategory.COWSWAP,
action: 'click-launch-app',
action: COW_SWAP_CTA.action,
})
}
>
Launch app
{COW_SWAP_CTA.text}
</Link>
</SectionTitleWrapper>
</ContainerCardSection>
Expand Down
6 changes: 4 additions & 2 deletions apps/cow-fi/components/Layout/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { MenuItem, ProductVariant, Color, UI } from '@cowprotocol/ui'

import { CowFiCategory } from 'src/common/analytics/types'

import { COW_SWAP_CTA } from '@/const/cta'

const analytics = initGtm()

export const PAGE_MAX_WIDTH = 1760
Expand Down Expand Up @@ -106,8 +108,8 @@ export const NAV_ADDITIONAL_BUTTONS = [
color: Color.cowamm_green,
},
{
label: 'Trade on CoW Swap',
href: 'https://swap.cow.fi/#/1/swap/USDC/COW',
label: COW_SWAP_CTA.text,
href: COW_SWAP_CTA.deeplinkHref,
utmContent: 'menubar-nav-button-trade-on-cow-swap',
onClick: () =>
analytics.sendEvent({
Expand Down
7 changes: 7 additions & 0 deletions apps/cow-fi/const/cta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const COW_SWAP_CTA = {
text: 'Trade on CoW Swap',
action: 'click-trade-on-cow-swap',
utmContent: 'cow-swap-trade-on-cow-swap-button',
href: 'https://swap.cow.fi/',
deeplinkHref: 'https://swap.cow.fi/#/1/swap/USDC/COW',
} as const
9 changes: 5 additions & 4 deletions apps/cow-fi/data/home/const.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import IMG_TUBE from '@cowprotocol/assets/images/image-tube.svg'
import { Color, ProductVariant, UI } from '@cowprotocol/ui'

import SVG from 'react-inlinesvg'
import { CowFiCategory } from 'src/common/analytics/types'

import { Link, LinkType } from '@/components/Link'
import { COW_SWAP_CTA } from '@/const/cta'
import {
ContainerCard,
ContainerCardSection,
Expand All @@ -23,7 +25,6 @@ import {
TopicList,
TopicTitle,
} from '@/styles/styled'
import { CowFiCategory } from 'src/common/analytics/types'

const analytics = initGtm()

Expand All @@ -45,9 +46,9 @@ export const PRODUCT_LIST = [
{
title: 'CoW Swap',
description: 'The DEX that lets you do what you want',
linkHref: 'https://swap.cow.fi/#/1/swap/USDC/COW',
linkText: 'Start trading',
linkEvent: 'click-trade-on-cow-swap',
linkHref: COW_SWAP_CTA.deeplinkHref,
linkText: COW_SWAP_CTA.text,
linkEvent: COW_SWAP_CTA.action,
linkExternal: true,
linkUtmContent: 'home-page-trade-on-cow-swap',
bgColor: `var(${UI.COLOR_BLUE_300_PRIMARY})`,
Expand Down