Skip to content

Commit

Permalink
chore: render slides from config, update btn
Browse files Browse the repository at this point in the history
  • Loading branch information
thechefpenguin committed Nov 4, 2024
1 parent b2f6d7a commit db25147
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/components/AdPanel/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const AdButton = ({ children, isExternal, endIcon, ...props }: AdButtonPr
variant="subtle"
width="fit-content"
padding="7px 8px 9px 8px"
endIcon={isExternal ? <OpenNewIcon color="invertedContrast" /> : endIcon}
endIcon={endIcon || isExternal ? <OpenNewIcon color="invertedContrast" /> : null}
{...props}
>
{children}
Expand Down
7 changes: 4 additions & 3 deletions apps/web/src/components/AdPanel/CardLayouts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Autoplay, EffectFade, Pagination } from 'swiper/modules'
import { SwiperSlide } from 'swiper/react'
import { StyledSwiper } from './CarrouselWithSlider'
import { TitleContentAd } from './Variations/TitleContentAd'
import { AdList } from './config'

const FloatingContainer = styled(Box)`
position: fixed;
Expand Down Expand Up @@ -42,9 +43,9 @@ export const DesktopCard = () => {
loop
pagination={{ clickable: true }}
>
<SwiperSlide>
<TitleContentAd />
</SwiperSlide>
{AdList.map((ad) => (
<SwiperSlide key={ad.id}>{ad.component}</SwiperSlide>
))}
</StyledSwiper>
</FloatingContainer>,
portalRoot,
Expand Down
13 changes: 13 additions & 0 deletions apps/web/src/components/AdPanel/Variations/ContentAd.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { AdButton } from '../Button'
import { AdCard } from '../Card'
import { Content } from '../Content'

export const ContentAd = () => {
return (
<AdCard imageUrl="/images/adpanel-test/bannerImg1.png">
<Content>PancakeSwap Prediction Telegram Bot is now live!</Content>

<AdButton isExternal>Play Now!</AdButton>
</AdCard>
)
}
13 changes: 13 additions & 0 deletions apps/web/src/components/AdPanel/config.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { ContentAd } from './Variations/ContentAd'
import { TitleContentAd } from './Variations/TitleContentAd'

export const AdList = [
{
id: 'title-content-ad',
component: <TitleContentAd />,
},
{
id: 'content-ad',
component: <ContentAd />,
},
]

0 comments on commit db25147

Please sign in to comment.