From bb515d09ddd2007b41a1bf552b316961c4231a20 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Tue, 28 Dec 2021 18:38:25 -0800 Subject: [PATCH] Normalize playlist view --- src/components/card/Card.tsx | 41 +++++++++++++++++++++- src/components/playlist/PlaylistView.tsx | 44 ++++++++++++++++++------ 2 files changed, 73 insertions(+), 12 deletions(-) diff --git a/src/components/card/Card.tsx b/src/components/card/Card.tsx index aa835cb..e4ec84e 100644 --- a/src/components/card/Card.tsx +++ b/src/components/card/Card.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { Icon } from 'rsuite'; import { useHistory } from 'react-router-dom'; +import { LazyLoadImage } from 'react-lazy-load-image-component'; import cacheImage from '../shared/cacheImage'; import { useAppDispatch, useAppSelector } from '../../redux/hooks'; import { @@ -35,6 +36,7 @@ import { addModalPage } from '../../redux/miscSlice'; import { notifyToast } from '../shared/toast'; import CustomTooltip from '../shared/CustomTooltip'; import { apiController } from '../../api/controller'; +import { CoverArtWrapper, CustomImageGrid, CustomImageGridWrapper } from '../layout/styled'; const Card = ({ onClick, @@ -203,7 +205,44 @@ const Card = ({ } }} > - {rest.coverArt.match('placeholder') ? ( + {Array.isArray(rest.coverArt) ? ( + + + + + + + + + + + + + + + + + ) : rest.coverArt.match('placeholder') ? ( { header={ } cacheImages={{ enabled: settings.getSync('cacheImages'), cacheType: 'playlist', id: data.id, }} - imageHeight={184} + imageHeight={185} title={data.title} subtitle={
@@ -541,7 +555,7 @@ const PlaylistView = ({ ...rest }) => { whiteSpace: 'pre-wrap', }} > - {data.comment ? data.comment : 'No description'} + {data.comment ? data.comment : ''} @@ -549,24 +563,26 @@ const PlaylistView = ({ ...rest }) => { handlePlayAppend('next')} disabled={playlist.entry?.length < 1} /> handlePlayAppend('later')} disabled={playlist.entry?.length < 1} /> { /> { } > - + { >