Skip to content

Commit

Permalink
chore: list new TC (#11094)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chef-Yogi authored Dec 27, 2024
1 parent 7781b48 commit 06d46e2
Show file tree
Hide file tree
Showing 5 changed files with 190 additions and 7 deletions.
36 changes: 36 additions & 0 deletions apps/web/src/components/AdPanel/Ads/AdTradingCompetition.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { useTranslation } from '@pancakeswap/localization'
import { Link } from '@pancakeswap/uikit'
import { tradingCompetitionConfig } from 'components/PhishingWarningBanner/TradingCompetition'
import { BodyText } from '../BodyText'
import { AdButton } from '../Button'
import { AdCard } from '../Card'

import { AdPlayerProps } from '../types'
import { getImageUrl } from '../utils'

export const AdTradingCompetition = (props: AdPlayerProps & { token: 'aitech' | 'apt' | 'vinu' | 'bfg' }) => {
const { t } = useTranslation()
const { token, ...rest } = props

return (
<AdCard imageUrl={getImageUrl(tradingCompetitionConfig[token].imgUrl)} {...rest}>
<BodyText mb="0">
{t('Swap %token% to win a share of', { token: token.toUpperCase() })}${tradingCompetitionConfig[token].reward}
<Link fontSize="inherit" href={tradingCompetitionConfig[token].swapUrl} color="secondary" bold>
{t('Swap Now')}
</Link>
</BodyText>
<AdButton mt="16px" href={tradingCompetitionConfig[token].learnMoreUrl} externalIcon isExternalLink>
{t('Learn More')}
</AdButton>
</AdCard>
)
}

export const AdTradingCompetitionAiTech = (props: AdPlayerProps) => {
return <AdTradingCompetition token="aitech" {...props} />
}

export const AdTradingCompetitionApt = (props: AdPlayerProps) => {
return <AdTradingCompetition token="apt" {...props} />
}
19 changes: 13 additions & 6 deletions apps/web/src/components/AdPanel/config.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { useMatchBreakpoints } from '@pancakeswap/uikit'
import { useMemo } from 'react'
import { AdCakeStaking } from './Ads/AdCakeStaking'
import { AdMevProtection } from './Ads/AdMevProtection'
import { AdOptionsTrading } from './Ads/AdOptionsTrading'
import { AdPCSX } from './Ads/AdPCSX'
import { AdRocker } from './Ads/AdRocker'
import { AdSpringboard } from './Ads/AdSpringboard'
import { AdTelegramBot } from './Ads/AdTelegramBot'
import { AdTradingCompetitionAiTech, AdTradingCompetitionApt } from './Ads/AdTradingCompetition'
import { ExpandableAd } from './Expandable/ExpandableAd'
import { shouldRenderOnPages } from './renderConditions'

Expand Down Expand Up @@ -42,13 +41,21 @@ export const useAdConfig = () => {
component: <AdSpringboard />,
},
{
id: 'ad-mev',
component: <AdMevProtection />,
id: 'ad-aitech-tc',
component: <AdTradingCompetitionAiTech />,
},
{
id: 'prediction-telegram-bot',
component: <AdTelegramBot />,
id: 'ad-apt-tc',
component: <AdTradingCompetitionApt />,
},
// {
// id: 'ad-mev',
// component: <AdMevProtection />,
// },
// {
// id: 'prediction-telegram-bot',
// component: <AdTelegramBot />,
// },
{
id: 'pcsx',
component: <AdPCSX />,
Expand Down
108 changes: 108 additions & 0 deletions apps/web/src/components/PhishingWarningBanner/TradingCompetition.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import { useTranslation } from '@pancakeswap/localization'
import { ArrowForwardIcon, Box, Link, Text } from '@pancakeswap/uikit'
import { VerticalDivider } from '@pancakeswap/widgets-internal'

export const tradingCompetitionConfig = {
aitech: {
imgUrl: 'aitech_competition',
swapUrl:
'https://pancakeswap.finance/?inputCurrency=0x55d398326f99059fF775485246999027B3197955&outputCurrency=0x2D060Ef4d6BF7f9e5edDe373Ab735513c0e4F944&utm_source=Website&utm_medium=infostripe&utm_campaign=AITECH&utm_id=TradingCompetition',
learnMoreUrl:
'https://blog.pancakeswap.finance/articles/pancake-swap-x-solidus-ai-tech-trading-competition-50-000-in-rewards?utm_source=Website&utm_medium=infostripe&utm_campaign=AITECH&utm_id=TradingCompetition',
reward: '50,000',
},
bfg: {
imgUrl: 'bfg_competition',
swapUrl:
'https://pancakeswap.finance/?inputCurrency=0x55d398326f99059fF775485246999027B3197955&outputCurrency=0xBb46693eBbEa1aC2070E59B4D043b47e2e095f86&utm_source=Website&utm_medium=infostripe&utm_campaign=BFG&utm_id=TradingCompetition',
learnMoreUrl:
'https://blog.pancakeswap.finance/articles/pancake-swap-x-bet-fury-trading-competition-50-000-in-rewards?utm_source=Website&utm_medium=infostripe&utm_campaign=BFG&utm_id=TradingCompetition',
reward: '50,000',
},
apt: {
imgUrl: 'apt_competition',
swapUrl: ' https://aptos.pancakeswap.finance/swap',
learnMoreUrl:
'https://blog.pancakeswap.finance/articles/aptos-pancake-swap-trading-competition-win-from-8-000-apt?utm_source=Website&utm_medium=infostripe&utm_campaign=APT&utm_id=TradingCompetition',
reward: '8,000',
},
vinu: {
imgUrl: 'vinu_competition',
swapUrl:
'https://pancakeswap.finance/?inputCurrency=0x55d398326f99059fF775485246999027B3197955&outputCurrency=0xfEbe8C1eD424DbF688551D4E2267e7A53698F0aa&utm_source=Website&utm_medium=infostripe&utm_campaign=VINU&utm_id=TradingCompetition',
learnMoreUrl:
'https://blog.pancakeswap.finance/articles/pancake-swap-x-vita-inu-trading-competition-100-000-in-rewards?utm_source=Website&utm_medium=infostripe&utm_campaign=VINU&utm_id=TradingCompetition',
reward: '100,000',
},
}

export const TradingCompetition: React.FC<{ token: 'aitech' | 'bfg' | 'apt' | 'vinu' }> = ({ token }) => {
const { t } = useTranslation()

return (
<Box mr={['6px']}>
<Text bold as="span" color="#FFFFFF" fontSize={['12px', '12px', '14px']}>
{t('Swap %token% to win a share of', { token })}
</Text>
<Text bold as="span" color="#FCC631" fontSize={['12px', '12px', '14px']}>
${tradingCompetitionConfig[token].reward}
</Text>
<Text bold as="span" color="#FFFFFF" fontSize={['12px', '12px', '14px']}>
{t('with daily prizes and leaderboard rewards!')}
</Text>

<Link
external
display="inline-flex !important"
verticalAlign="baseline"
showExternalIcon
fontSize={['12px', '12px', '14px']}
href={tradingCompetitionConfig[token].swapUrl}
>
{t('Swap Now')}
<ArrowForwardIcon
style={{
fill: '#53DEE9',
}}
/>
</Link>
<VerticalDivider
bg="#53DEE9"
style={{
display: 'inline-block',
verticalAlign: 'middle',
height: '18px',
opacity: 0.4,
width: '1px',
marginLeft: '0px',
marginRight: '8px',
}}
/>
<Link
external
display="inline !important"
showExternalIcon
fontSize={['12px', '12px', '14px']}
href={tradingCompetitionConfig[token].learnMoreUrl}
>
{t('Learn More')}
</Link>
</Box>
)
}

export const TradingCompetitionAiTech = () => {
return <TradingCompetition token="aitech" />
}

export const TradingCompetitionBfg = () => {
return <TradingCompetition token="bfg" />
}

export const TradingCompetitionApt = () => {
return <TradingCompetition token="apt" />
}

export const TradingCompetitionVinu = () => {
return <TradingCompetition token="vinu" />
}
30 changes: 30 additions & 0 deletions apps/web/src/components/PhishingWarningBanner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import { Countdown } from './Countdown'
import { Step1 } from './Step1'
import { Step2 } from './Step2'
import { Step3 } from './Step3'
import {
TradingCompetitionAiTech,
TradingCompetitionApt,
TradingCompetitionBfg,
TradingCompetitionVinu,
} from './TradingCompetition'

const Container = styled(Flex).withConfig({ shouldForwardProp: (prop) => !['$background'].includes(prop) })<{
$background?: string
Expand Down Expand Up @@ -116,6 +122,30 @@ const CONFIG: BannerConfig[] = [
stripeImageWidth: '92px',
stripeImageAlt: 'PCSX',
},
{
component: TradingCompetitionAiTech,
stripeImage: `${ASSET_CDN}/web/promotions/aitech_competition.png`,
stripeImageWidth: '92px',
stripeImageAlt: 'aitech_competition',
},
{
component: TradingCompetitionBfg,
stripeImage: `${ASSET_CDN}/web/promotions/bfg_competition.png`,
stripeImageWidth: '92px',
stripeImageAlt: 'bfg_competition',
},
{
component: TradingCompetitionApt,
stripeImage: `${ASSET_CDN}/web/promotions/apt_competition.png`,
stripeImageWidth: '92px',
stripeImageAlt: 'apt_competition',
},
{
component: TradingCompetitionVinu,
stripeImage: `${ASSET_CDN}/web/promotions/vinu_competition.png`,
stripeImageWidth: '92px',
stripeImageAlt: 'vinu_competition',
},
]

const PhishingWarningBanner: React.FC<React.PropsWithChildren> = () => {
Expand Down
4 changes: 3 additions & 1 deletion packages/localization/src/config/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3670,5 +3670,7 @@
"Select your stake and withdraw": "Select your stake and withdraw",
"Learn more here": "Learn more here",
"No Existing Orders": "No Existing Orders",
"Existing Orders": "Existing Orders"
"Existing Orders": "Existing Orders",
"Swap %token% to win a share of": "Swap %token% to win a share of",
"with daily prizes and leaderboard rewards!": "with daily prizes and leaderboard rewards!"
}

0 comments on commit 06d46e2

Please sign in to comment.