From 24b0d37bd17ddd751584a242f69f74f0dc21b8ab Mon Sep 17 00:00:00 2001 From: jeffvli Date: Sat, 19 Nov 2022 20:49:28 -0800 Subject: [PATCH] Adjust grid card rows --- .../virtual-grid/grid-card/default-card.tsx | 11 +++++++++-- .../virtual-grid/grid-card/poster-card.tsx | 13 +++++++++++-- .../virtual-grid/virtual-infinite-grid.tsx | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/virtual-grid/grid-card/default-card.tsx b/src/renderer/components/virtual-grid/grid-card/default-card.tsx index 616d0c9e8..b30b3152c 100644 --- a/src/renderer/components/virtual-grid/grid-card/default-card.tsx +++ b/src/renderer/components/virtual-grid/grid-card/default-card.tsx @@ -109,7 +109,7 @@ const DetailSection = styled.div` const Row = styled.div<{ $secondary?: boolean }>` width: 100%; max-width: 100%; - height: 25px; + height: 22px; padding: 0 0.2rem; overflow: hidden; color: ${({ $secondary }) => @@ -236,6 +236,7 @@ export const DefaultCard = ({ $secondary={index > 0} component={Link} overflow="hidden" + size={index > 0 ? 'xs' : 'md'} to={generatePath( row.route!.route, row.route!.slugs?.reduce((acc, slug) => { @@ -264,6 +265,7 @@ export const DefaultCard = ({ $noSelect $secondary={index > 0} overflow="hidden" + size={index > 0 ? 'xs' : 'md'} > {row.arrayProperty && item[row.arrayProperty]} @@ -294,7 +296,12 @@ export const DefaultCard = ({ {data && data[row.property]} ) : ( - 0} overflow="hidden"> + 0} + overflow="hidden" + size={index > 0 ? 'xs' : 'md'} + > {data && data[row.property]} )} diff --git a/src/renderer/components/virtual-grid/grid-card/poster-card.tsx b/src/renderer/components/virtual-grid/grid-card/poster-card.tsx index daba6894d..cb6f60062 100644 --- a/src/renderer/components/virtual-grid/grid-card/poster-card.tsx +++ b/src/renderer/components/virtual-grid/grid-card/poster-card.tsx @@ -110,7 +110,7 @@ const DetailSection = styled.div` const Row = styled.div<{ $secondary?: boolean }>` width: 100%; max-width: 100%; - height: 25px; + height: 22px; padding: 0 0.2rem; overflow: hidden; color: ${({ $secondary }) => @@ -217,6 +217,7 @@ export const PosterCard = ({ {itemIndex > 0 && ( 0 ? 'xs' : 'md'} sx={{ display: 'inline-block', padding: '0 2px 0 1px', @@ -231,6 +232,7 @@ export const PosterCard = ({ $secondary={index > 0} component={Link} overflow="hidden" + size={index > 0 ? 'xs' : 'md'} to={generatePath( row.route!.route, row.route!.slugs?.reduce((acc, slug) => { @@ -258,6 +260,7 @@ export const PosterCard = ({ $noSelect $secondary={index > 0} overflow="hidden" + size={index > 0 ? 'xs' : 'md'} > {row.arrayProperty && item[row.arrayProperty]} @@ -274,6 +277,7 @@ export const PosterCard = ({ $noSelect component={Link} overflow="hidden" + size={index > 0 ? 'xs' : 'md'} to={generatePath( row.route.route, row.route.slugs?.reduce((acc, slug) => { @@ -287,7 +291,12 @@ export const PosterCard = ({ {data && data[row.property]} ) : ( - 0} overflow="hidden"> + 0} + overflow="hidden" + size={index > 0 ? 'xs' : 'md'} + > {data && data[row.property]} )} diff --git a/src/renderer/components/virtual-grid/virtual-infinite-grid.tsx b/src/renderer/components/virtual-grid/virtual-infinite-grid.tsx index 4844fed6c..84fa4ca63 100644 --- a/src/renderer/components/virtual-grid/virtual-infinite-grid.tsx +++ b/src/renderer/components/virtual-grid/virtual-infinite-grid.tsx @@ -52,7 +52,7 @@ export const VirtualInfiniteGrid = ({ return { columnCount: itemsPerRow, - itemHeight: itemSize! + cardRows.length * 25 + itemGap, + itemHeight: itemSize! + cardRows.length * 22 + itemGap, itemWidth: itemSize! + itemGap, rowCount: Math.ceil(itemCount / itemsPerRow), };