From 8a520aed591c0434f4dd6ed589bdc4859b35bceb Mon Sep 17 00:00:00 2001 From: Christiaan Scheermeijer Date: Mon, 21 Jun 2021 17:28:51 +0200 Subject: [PATCH] fix(home): fix featured shelf height --- src/screens/Home/Home.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/screens/Home/Home.tsx b/src/screens/Home/Home.tsx index 1f6d5c816..3785dc38a 100644 --- a/src/screens/Home/Home.tsx +++ b/src/screens/Home/Home.tsx @@ -88,6 +88,7 @@ const Home = (): JSX.Element => { const calculateHeight = (index: number): number => { const item = content[index]; + const isDesktop = breakpoint >= Breakpoint.sm; const isMobile = breakpoint === Breakpoint.xs; if (!item) return 0; @@ -97,7 +98,7 @@ const Home = (): JSX.Element => { const calculateFeatured = () => { const tilesToShow = featuredTileBreakpoints[breakpoint]; const shelfMetaHeight = 24; - const shelfHorizontalMargin = document.body.offsetWidth * 0.4; + const shelfHorizontalMargin = isDesktop ? document.body.offsetWidth * 0.4 : 0; const cardWidth = (document.body.offsetWidth - shelfHorizontalMargin) / tilesToShow; const cardHeight = cardWidth * (9 / 16);