Skip to content

Commit 549d4a7

Browse files
Fixed carousel
fixed problem with carousel component
1 parent 75fc534 commit 549d4a7

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

app/components/newscarousel.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const Item = (props) => {
5858
height={140}
5959
src={props.item.attributes.imageUrl}
6060
alt={props.item.attributes.name}
61+
className={styles.imgItm}
6162
/>
6263
<div className={`p-2 p-md-3 h-auto + ${styles.content}`}>
6364
<h2 className={`${styles.heading}`}>{props.item.attributes.name}</h2>
@@ -98,6 +99,13 @@ function Newscarousel(props) {
9899
initialSlide: 2,
99100
},
100101
},
102+
{
103+
breakpoint: 300,
104+
settings: {
105+
slidesToShow: 1,
106+
slidesToScroll: 1
107+
},
108+
}
101109
]}
102110
prevArrow={<PrevArrow />}
103111
nextArrow={<NextArrow />}

app/styles/Newscarousel.module.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,18 @@
3636
.carousel-item-title {
3737
font-size: 22.5px;
3838
}
39+
40+
.imgItm{
41+
width: 100%;
42+
height: 100%;
43+
}
44+
45+
.content{
46+
height: 120px !important;
47+
}
48+
49+
@media only screen and (max-width: 300px) {
50+
.content{
51+
height: 80px !important;
52+
}
53+
}

0 commit comments

Comments
 (0)