diff --git a/apps/web/public/images/adpanel-test/bannerImg1.png b/apps/web/public/images/adpanel-test/bannerImg1.png new file mode 100644 index 0000000000000..06afea89465dd Binary files /dev/null and b/apps/web/public/images/adpanel-test/bannerImg1.png differ diff --git a/apps/web/src/components/AdPanel/Button.tsx b/apps/web/src/components/AdPanel/Button.tsx new file mode 100644 index 0000000000000..e37f185d697ce --- /dev/null +++ b/apps/web/src/components/AdPanel/Button.tsx @@ -0,0 +1,12 @@ +import { Button, ButtonProps } from '@pancakeswap/uikit' +import { PropsWithChildren } from 'react' + +interface AdButtonProps extends ButtonProps, PropsWithChildren {} + +export const AdButton = ({ children }: AdButtonProps) => { + return ( + + ) +} diff --git a/apps/web/src/components/AdPanel/Card.tsx b/apps/web/src/components/AdPanel/Card.tsx index 4eb7353e114af..ae3d0ca6c6a17 100644 --- a/apps/web/src/components/AdPanel/Card.tsx +++ b/apps/web/src/components/AdPanel/Card.tsx @@ -5,21 +5,27 @@ const BaseCard = styled(Box)` position: fixed; bottom: 30px; right: 30px; - border: 2px solid red; - width: 326px; - height: 188px; + padding: 16px; + width: 328px; + height: 164px; background-color: ${({ theme }) => theme.colors.card}; border-radius: ${({ theme }) => theme.radii.default}; + border: 1px solid ${({ theme }) => theme.colors.cardBorder}; ` const Content = styled(Flex)` - max-width: 119px; + position: relative; + width: 148px; + z-index: 2; + display: flex; + flex-direction: column; ` const PositionedImage = styled(Image)` position: absolute; - top: 0; + bottom: 0; right: 0; + z-index: 1; ` interface AdCardProps { @@ -29,7 +35,7 @@ interface AdCardProps { } export const AdCard = ({ children, imageUrl, alt }: AdCardProps) => { - // Drag handle and other slots will come here as well + // Drag handle, Slider and other slots will come here return ( {children} diff --git a/apps/web/src/components/AdPanel/CardLayouts.tsx b/apps/web/src/components/AdPanel/CardLayouts.tsx index dc5d4a8d576ca..71566fc6a4037 100644 --- a/apps/web/src/components/AdPanel/CardLayouts.tsx +++ b/apps/web/src/components/AdPanel/CardLayouts.tsx @@ -2,14 +2,20 @@ import { getPortalRoot, useMatchBreakpoints } from '@pancakeswap/uikit' import { createPortal } from 'react-dom' import { TitleAd } from './Variations/TitleAd' +/** + * Renders floating Ad banners on desktop + */ export const DesktopCard = () => { const portalRoot = getPortalRoot() - const { isMobile } = useMatchBreakpoints() + const { isDesktop } = useMatchBreakpoints() - return portalRoot && !isMobile ? createPortal(, portalRoot) : null + return portalRoot && isDesktop ? createPortal(, portalRoot) : null } +/** + * Renders Ad banners on mobile and tablet + */ export const MobileCard = () => { - const { isMobile } = useMatchBreakpoints() - return isMobile ? : null + const { isDesktop } = useMatchBreakpoints() + return !isDesktop ? : null } diff --git a/apps/web/src/components/AdPanel/Title.tsx b/apps/web/src/components/AdPanel/Title.tsx index 92b19871b0528..1dd5e818e447c 100644 --- a/apps/web/src/components/AdPanel/Title.tsx +++ b/apps/web/src/components/AdPanel/Title.tsx @@ -1,11 +1,12 @@ import { Text, TextProps } from '@pancakeswap/uikit' +import { PropsWithChildren } from 'react' -interface TitleProps extends TextProps {} +interface TitleProps extends TextProps, PropsWithChildren {} -export const Title = (props: TitleProps) => { +export const Title = ({ children, ...props }: TitleProps) => { return ( - - AdPanel + + {children} ) } diff --git a/apps/web/src/components/AdPanel/Variations/TitleAd.tsx b/apps/web/src/components/AdPanel/Variations/TitleAd.tsx index f33391713529b..2152e84c04719 100644 --- a/apps/web/src/components/AdPanel/Variations/TitleAd.tsx +++ b/apps/web/src/components/AdPanel/Variations/TitleAd.tsx @@ -1,5 +1,13 @@ +import { AdButton } from '../Button' import { AdCard } from '../Card' +import { Title } from '../Title' export const TitleAd = () => { - return + return ( + + Enjoy Gas-Free Transactions on zkSync PancakeSwap + + Quick start + + ) } diff --git a/apps/web/src/components/AdPanel/index.ts b/apps/web/src/components/AdPanel/index.ts index 650259ba9f85d..989d03c6f04b4 100644 --- a/apps/web/src/components/AdPanel/index.ts +++ b/apps/web/src/components/AdPanel/index.ts @@ -1,7 +1,13 @@ +import { AdButton as Button } from './Button' +import { AdCard as Card } from './Card' import { DesktopCard, MobileCard } from './CardLayouts' +import { Title } from './Title' // TODO: Later move to widgets-internal with conventional exporting export const AdPanel = { DesktopCard, MobileCard, + Card, + Title, + Button, }