Skip to content

Commit

Permalink
fix: carousel on mobile devices
Browse files Browse the repository at this point in the history
  • Loading branch information
siandreev committed Jan 22, 2024
1 parent ca3c1d6 commit 6a47228
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions packages/uikit/src/pages/browser/PromotionsCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { CarouselApp } from '@tonkeeper/core/dist/tonkeeperApi/tonendpoint';
import { useAppContext } from '../../hooks/appContext';

const CarouselCard = styled.div<{ img: string }>`
width: 448px;
height: 224px;
width: 100%;
aspect-ratio: 2 / 1;
background-image: ${props => `url(${props.img})`};
background-size: cover;
Expand All @@ -19,16 +19,6 @@ const CarouselCard = styled.div<{ img: string }>`
align-items: flex-end;
justify-content: flex-start;
cursor: pointer;
@media (max-width: ${480}px) {
width: 400px;
height: 200px;
}
@media (max-width: ${436}px) {
width: 340px;
height: 170px;
}
`;
const CarouselCardFooter = styled(PromotedItem)`
margin-left: 1rem;
Expand All @@ -42,7 +32,13 @@ export const PromotionsCarousel: FC<{ apps: CarouselApp[]; className?: string }>
const speed = config.featured_play_interval || 1000 * 10;

return (
<Carousel className={className} gap="8px" autoplay={false} autoplaySpeed={speed}>
<Carousel
className={className}
gap="8px"
autoplay={true}
centerPadding="16px"
autoplaySpeed={speed}
>
{apps.map(item => (
<CarouselItem item={item} key={item.url} />
))}
Expand Down

0 comments on commit 6a47228

Please sign in to comment.