Skip to content

Commit

Permalink
Fixed carousel
Browse files Browse the repository at this point in the history
fixed problem with carousel component
  • Loading branch information
itsmanojthapa authored Jan 3, 2023
1 parent 75fc534 commit 549d4a7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/components/newscarousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const Item = (props) => {
height={140}
src={props.item.attributes.imageUrl}
alt={props.item.attributes.name}
className={styles.imgItm}
/>
<div className={`p-2 p-md-3 h-auto + ${styles.content}`}>
<h2 className={`${styles.heading}`}>{props.item.attributes.name}</h2>
Expand Down Expand Up @@ -98,6 +99,13 @@ function Newscarousel(props) {
initialSlide: 2,
},
},
{
breakpoint: 300,
settings: {
slidesToShow: 1,
slidesToScroll: 1
},
}
]}
prevArrow={<PrevArrow />}
nextArrow={<NextArrow />}
Expand Down
15 changes: 15 additions & 0 deletions app/styles/Newscarousel.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,18 @@
.carousel-item-title {
font-size: 22.5px;
}

.imgItm{
width: 100%;
height: 100%;
}

.content{
height: 120px !important;
}

@media only screen and (max-width: 300px) {
.content{
height: 80px !important;
}
}

0 comments on commit 549d4a7

Please sign in to comment.