-
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.
<!-- Before opening a pull request, please read the [contributing guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md) first --> <!-- start pr-codex --> --- ## PR-Codex overview The focus of this PR is to add a `MultiChainBanner` component and update translations and banners for a PancakeSwap Multichain Celebration. ### Detailed summary - Added `MultiChainBanner` component - Updated translations and banners for Multichain Celebration - Added new banner components and configurations > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
- Loading branch information
Showing
8 changed files
with
92 additions
and
11 deletions.
There are no files selected for viewing
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,5 @@ | ||
--- | ||
'@pancakeswap/widgets-internal': patch | ||
--- | ||
|
||
Added BannerDesc Component. |
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 |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
"LINEA", | ||
"Merkl", | ||
"multicall", | ||
"Multichain", | ||
"OPBNB", | ||
"pancakeswap", | ||
"preinstall", | ||
|
60 changes: 60 additions & 0 deletions
60
apps/web/src/views/Home/components/Banners/MultichainBanner.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,60 @@ | ||
import { useTranslation } from '@pancakeswap/localization' | ||
import { ArrowForwardIcon, Flex, useMatchBreakpoints } from '@pancakeswap/uikit' | ||
import { | ||
BackgroundGraphic, | ||
BannerActionContainer, | ||
BannerContainer, | ||
BannerDesc, | ||
BannerGraphics, | ||
BannerMain, | ||
BannerTitle, | ||
GraphicDetail, | ||
LinkExternalAction, | ||
PancakeSwapBadge, | ||
} from '@pancakeswap/widgets-internal' | ||
import { ASSET_CDN } from 'config/constants/endpoints' | ||
|
||
const bgMobile = `${ASSET_CDN}/web/banners/multichain/bg-mobile.png` | ||
const bgDesktop = `${ASSET_CDN}/web/banners/multichain/bg-desktop.png` | ||
|
||
const bgSmVariant: GraphicDetail = { | ||
src: bgMobile, | ||
width: 272, | ||
height: 224, | ||
} | ||
|
||
const bgXsVariant: GraphicDetail = { | ||
src: bgMobile, | ||
width: 218, | ||
height: 182, | ||
} | ||
|
||
const participateLink = 'https://app.questn.com/PancakeSwap' | ||
|
||
export const MultiChainBanner = () => { | ||
const { t } = useTranslation() | ||
const { isMobile } = useMatchBreakpoints() | ||
|
||
const participateAction = ( | ||
<LinkExternalAction href={participateLink} color="white" showExternalIcon={false}> | ||
<Flex alignItems="center" style={{ whiteSpace: 'nowrap' }}> | ||
{t('Participate Now')} | ||
<ArrowForwardIcon color="white" ml="4px" /> | ||
</Flex> | ||
</LinkExternalAction> | ||
) | ||
|
||
return ( | ||
<BannerContainer background="radial-gradient(338.53% 307.7% at 0% -37.33%, #5C6BB4 0%, #5AE1EC 100%)"> | ||
<BannerMain | ||
badges={<PancakeSwapBadge whiteText />} | ||
title={<BannerTitle variant="orange">{t('PancakeSwap Multichain Celebration')}</BannerTitle>} | ||
desc={isMobile ? null : <BannerDesc color="white">{t('Starting MAR 14 - Over $3500 in prizes!')}</BannerDesc>} | ||
actions={<BannerActionContainer>{participateAction}</BannerActionContainer>} | ||
/> | ||
<BannerGraphics> | ||
<BackgroundGraphic src={bgDesktop} width={468} height={224} sm={bgSmVariant} xs={bgXsVariant} /> | ||
</BannerGraphics> | ||
</BannerContainer> | ||
) | ||
} |
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
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
13 changes: 13 additions & 0 deletions
13
packages/widgets-internal/components/Banner/BannerDesc.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,13 @@ | ||
import { Text } from "@pancakeswap/uikit"; | ||
import styled from "styled-components"; | ||
|
||
export const BannerDesc = styled(Text)` | ||
font-size: 14px; | ||
font-weight: 600; | ||
line-height: 120%; | ||
${({ theme }) => theme.mediaQueries.sm} { | ||
font-size: 16px; | ||
white-space: nowrap; | ||
} | ||
`; |
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