-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
190 additions
and
7 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
apps/web/src/components/AdPanel/Ads/AdTradingCompetition.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
apps/web/src/components/PhishingWarningBanner/TradingCompetition.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters