Skip to content

Commit

Permalink
feat: 🎸 Add andy competition
Browse files Browse the repository at this point in the history
  • Loading branch information
chef-ryan committed Feb 13, 2025
1 parent 7aa89fe commit 5f5597b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
6 changes: 5 additions & 1 deletion apps/web/src/components/AdPanel/Ads/AdTradingCompetition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { AdCard } from '../Card'
import { AdPlayerProps } from '../types'
import { getImageUrl } from '../utils'

export const AdTradingCompetition = (props: AdPlayerProps & { token: 'aitech' | 'apt' | 'vinu' | 'bfg' }) => {
export const AdTradingCompetition = (props: AdPlayerProps & { token: 'aitech' | 'apt' | 'vinu' | 'bfg' | 'andy' }) => {
const { t } = useTranslation()
const { token, ...rest } = props
const { unit, reward } = tradingCompetitionConfig[token]
Expand Down Expand Up @@ -44,3 +44,7 @@ export const AdTradingCompetitionBfg = (props: AdPlayerProps) => {
export const AdTradingCompetitionVinu = (props: AdPlayerProps) => {
return <AdTradingCompetition token="vinu" {...props} />
}

export const AdTradingCompetitionAndy = (props: AdPlayerProps) => {
return <AdTradingCompetition token="andy" {...props} />
}
8 changes: 4 additions & 4 deletions apps/web/src/components/AdPanel/config.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useMatchBreakpoints } from '@pancakeswap/uikit'
import { useMemo } from 'react'
import { AdCakeStaking } from './Ads/AdCakeStaking'
import { AdPCSX } from './Ads/AdPCSX'
import { AdIfo } from './Ads/AdIfo'
import { AdPCSX } from './Ads/AdPCSX'
import { AdSpringboard } from './Ads/AdSpringboard'
import { AdTradingCompetitionVinu } from './Ads/AdTradingCompetition'
import { AdTradingCompetitionAndy } from './Ads/AdTradingCompetition'
import { ExpandableAd } from './Expandable/ExpandableAd'
import { shouldRenderOnPages } from './renderConditions'
import { useShouldRenderAdIfo } from './useShouldRenderAdIfo'
Expand Down Expand Up @@ -42,8 +42,8 @@ export const useAdConfig = () => {
component: <AdSpringboard />,
},
{
id: 'ad-vinu-tc',
component: <AdTradingCompetitionVinu />,
id: 'ad-andy-tc',
component: <AdTradingCompetitionAndy />,
},
{
id: 'ad-ifo',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,18 @@ export const tradingCompetitionConfig = {
reward: '100,000',
unit: '$',
},
andy: {
imgUrl: 'andy_competition',
swapUrl:
'https://pancakeswap.finance/?outputCurrency=0x01CA78a2B5F1a9152D8A3A625bd7dF5765eeE1D8&utm_source=Website&utm_medium=banner&utm_campaign=ANDY&utm_id=TradingCompetition',
learnMoreUrl:
'https://blog.pancakeswap.finance/articles/pancake-swap-x-andy-trading-competition-50-000-in-rewards?utm_source=Website&utm_medium=banner&utm_campaign=ANDY&utm_id=TradingCompetition',
reward: '50,000',
unit: '$',
},
}

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

const { unit, reward } = tradingCompetitionConfig[token]
Expand Down Expand Up @@ -96,3 +105,7 @@ export const TradingCompetition: React.FC<{ token: 'aitech' | 'bfg' | 'apt' | 'v
</Box>
)
}

export const TradingCompetitionInfoStripeAndy = () => {
return <TradingCompetition token="andy" />
}
7 changes: 7 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,7 @@ import { Countdown } from './Countdown'
import { Step1 } from './Step1'
import { Step2 } from './Step2'
import { Step3 } from './Step3'
import { TradingCompetitionInfoStripeAndy } from './TradingCompetition'

const Container = styled(Flex).withConfig({ shouldForwardProp: (prop) => !['$background'].includes(prop) })<{
$background?: string
Expand Down Expand Up @@ -116,6 +117,12 @@ const CONFIG: BannerConfig[] = [
stripeImageWidth: '92px',
stripeImageAlt: 'PCSX',
},
{
component: TradingCompetitionInfoStripeAndy,
stripeImage: `${ASSET_CDN}/web/phishing-warning/andy.png`,
stripeImageWidth: '92px',
stripeImageAlt: 'ANDY',
},
]

const PhishingWarningBanner: React.FC<React.PropsWithChildren> = () => {
Expand Down

0 comments on commit 5f5597b

Please sign in to comment.