Skip to content

Commit c5e50c4

Browse files
authored
Fix issue with hero image causing horizontal scroll (#1777)
1 parent 71bee99 commit c5e50c4

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

frontends/main/src/app-pages/HomePage/HomePage.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,18 @@ const MediaCarousel = styled(ResourceCarousel)(({ theme }) => ({
3838
},
3939
}))
4040

41+
const StyledContainer = styled(Container)({
42+
"@media (max-width: 1365px)": {
43+
overflow: "hidden",
44+
},
45+
})
46+
4147
const HomePage: React.FC = () => {
4248
return (
4349
<>
4450
<LearningResourceDrawer />
4551
<FullWidthBackground>
46-
<Container>
52+
<StyledContainer>
4753
<HeroSearch />
4854
<section>
4955
<FeaturedCoursesCarousel
@@ -52,7 +58,7 @@ const HomePage: React.FC = () => {
5258
config={carousels.FEATURED_RESOURCES_CAROUSEL}
5359
/>
5460
</section>
55-
</Container>
61+
</StyledContainer>
5662
</FullWidthBackground>
5763
<PersonalizeSection />
5864
<Container component="section">

frontends/main/src/page-components/HeroSearch/HeroSearch.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ const ImageContainer = styled.div(({ theme }) => ({
101101
alignItems: "center",
102102
justifyContent: "center",
103103
marginTop: "44px",
104-
transform: "translateX(48px)",
105104
width: "513px",
106105
aspectRatio: "513 / 522",
107106
[theme.breakpoints.down("md")]: {
108107
display: "none",
109108
},
110109
img: {
111110
width: "100%",
111+
transform: "translateX(48px)",
112112
},
113113
position: "relative",
114114
}))
@@ -209,13 +209,7 @@ const HeroImage: React.FC = () => {
209209

210210
return (
211211
<ImageContainer>
212-
<Image
213-
alt=""
214-
src={`/images/hero/hero-${imageIndex}.png`}
215-
fill
216-
priority
217-
sizes="513px"
218-
/>
212+
<Image alt="" src={`/images/hero/hero-${imageIndex}.png`} fill priority />
219213
</ImageContainer>
220214
)
221215
}

0 commit comments

Comments
 (0)