Skip to content

Commit

Permalink
fix(home): fix featured shelf height
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristiaanScheermeijer committed Jun 21, 2021
1 parent 4b69e2e commit 8a520ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/screens/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down

0 comments on commit 8a520ae

Please sign in to comment.