|
@ -47,6 +47,9 @@ const Card = ({ |
|
|
cacheImages, |
|
|
cacheImages, |
|
|
cachePath, |
|
|
cachePath, |
|
|
handleFavorite, |
|
|
handleFavorite, |
|
|
|
|
|
notVisibleByDefault, |
|
|
|
|
|
noInfoPanel, |
|
|
|
|
|
noModalButton, |
|
|
...rest |
|
|
...rest |
|
|
}: any) => { |
|
|
}: any) => { |
|
|
const history = useHistory(); |
|
|
const history = useHistory(); |
|
@ -190,18 +193,16 @@ const Card = ({ |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<> |
|
|
<> |
|
|
<CardPanel |
|
|
<CardPanel cardsize={size} style={rest.style}> |
|
|
tabIndex={0} |
|
|
|
|
|
cardsize={size} |
|
|
|
|
|
onKeyDown={(e: any) => { |
|
|
|
|
|
if (e.key === ' ' || e.key === 'Enter') { |
|
|
|
|
|
handleClick(); |
|
|
|
|
|
} |
|
|
|
|
|
}} |
|
|
|
|
|
style={rest.style} |
|
|
|
|
|
> |
|
|
|
|
|
<Overlay cardsize={size}> |
|
|
<Overlay cardsize={size}> |
|
|
<ImgPanel> |
|
|
<ImgPanel |
|
|
|
|
|
tabIndex={0} |
|
|
|
|
|
onKeyDown={(e: any) => { |
|
|
|
|
|
if (e.key === ' ' || e.key === 'Enter') { |
|
|
|
|
|
handleClick(); |
|
|
|
|
|
} |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
{rest.coverArt.match('placeholder') ? ( |
|
|
{rest.coverArt.match('placeholder') ? ( |
|
|
<CardImgWrapper |
|
|
<CardImgWrapper |
|
|
id="placeholder-wrapper" |
|
|
id="placeholder-wrapper" |
|
@ -234,7 +235,7 @@ const Card = ({ |
|
|
alt="img" |
|
|
alt="img" |
|
|
effect="opacity" |
|
|
effect="opacity" |
|
|
cardsize={size} |
|
|
cardsize={size} |
|
|
visibleByDefault={cacheImages} |
|
|
visibleByDefault={notVisibleByDefault ? false : cacheImages} |
|
|
afterLoad={() => { |
|
|
afterLoad={() => { |
|
|
if (cacheImages) { |
|
|
if (cacheImages) { |
|
|
cacheImage( |
|
|
cacheImage( |
|
@ -285,7 +286,7 @@ const Card = ({ |
|
|
/> |
|
|
/> |
|
|
</CustomTooltip> |
|
|
</CustomTooltip> |
|
|
)} |
|
|
)} |
|
|
{!rest.isModal && ( |
|
|
{!rest.isModal && !noModalButton && ( |
|
|
<CustomTooltip text="View in modal" delay={1000}> |
|
|
<CustomTooltip text="View in modal" delay={1000}> |
|
|
<ModalViewOverlayButton |
|
|
<ModalViewOverlayButton |
|
|
size={size <= 160 ? 'xs' : 'sm'} |
|
|
size={size <= 160 ? 'xs' : 'sm'} |
|
@ -299,44 +300,46 @@ const Card = ({ |
|
|
</ImgPanel> |
|
|
</ImgPanel> |
|
|
</Overlay> |
|
|
</Overlay> |
|
|
|
|
|
|
|
|
<InfoPanel cardsize={size}> |
|
|
{!noInfoPanel && ( |
|
|
<InfoSpan> |
|
|
<InfoPanel cardsize={size}> |
|
|
<CardTitleWrapper> |
|
|
<InfoSpan> |
|
|
<CustomTooltip text={rest.title}> |
|
|
|
|
|
<CardTitleButton |
|
|
|
|
|
appearance="link" |
|
|
|
|
|
tabIndex={-1} |
|
|
|
|
|
size="sm" |
|
|
|
|
|
onClick={handleClick} |
|
|
|
|
|
cardsize={size} |
|
|
|
|
|
> |
|
|
|
|
|
{rest.title} |
|
|
|
|
|
</CardTitleButton> |
|
|
|
|
|
</CustomTooltip> |
|
|
|
|
|
</CardTitleWrapper> |
|
|
|
|
|
</InfoSpan> |
|
|
|
|
|
<InfoSpan> |
|
|
|
|
|
{subUrl ? ( |
|
|
|
|
|
<CardTitleWrapper> |
|
|
<CardTitleWrapper> |
|
|
<CustomTooltip text={rest.subtitle}> |
|
|
<CustomTooltip text={rest.title}> |
|
|
<CardSubtitleButton |
|
|
<CardTitleButton |
|
|
appearance="link" |
|
|
appearance="link" |
|
|
tabIndex={-1} |
|
|
tabIndex={-1} |
|
|
size="xs" |
|
|
size="sm" |
|
|
onClick={handleSubClick} |
|
|
onClick={handleClick} |
|
|
cardsize={size} |
|
|
cardsize={size} |
|
|
> |
|
|
> |
|
|
{rest.subtitle} |
|
|
{rest.title} |
|
|
</CardSubtitleButton> |
|
|
</CardTitleButton> |
|
|
</CustomTooltip> |
|
|
</CustomTooltip> |
|
|
</CardTitleWrapper> |
|
|
</CardTitleWrapper> |
|
|
) : ( |
|
|
</InfoSpan> |
|
|
<CardSubtitle cardsize={size}> |
|
|
<InfoSpan> |
|
|
{rest.subtitle !== 'undefined' ? rest.subtitle : <span>​</span>} |
|
|
{subUrl ? ( |
|
|
</CardSubtitle> |
|
|
<CardTitleWrapper> |
|
|
)} |
|
|
<CustomTooltip text={rest.subtitle}> |
|
|
</InfoSpan> |
|
|
<CardSubtitleButton |
|
|
</InfoPanel> |
|
|
appearance="link" |
|
|
|
|
|
tabIndex={-1} |
|
|
|
|
|
size="xs" |
|
|
|
|
|
onClick={handleSubClick} |
|
|
|
|
|
cardsize={size} |
|
|
|
|
|
> |
|
|
|
|
|
{rest.subtitle} |
|
|
|
|
|
</CardSubtitleButton> |
|
|
|
|
|
</CustomTooltip> |
|
|
|
|
|
</CardTitleWrapper> |
|
|
|
|
|
) : ( |
|
|
|
|
|
<CardSubtitle cardsize={size}> |
|
|
|
|
|
{rest.subtitle !== 'undefined' ? rest.subtitle : <span>​</span>} |
|
|
|
|
|
</CardSubtitle> |
|
|
|
|
|
)} |
|
|
|
|
|
</InfoSpan> |
|
|
|
|
|
</InfoPanel> |
|
|
|
|
|
)} |
|
|
</CardPanel> |
|
|
</CardPanel> |
|
|
</> |
|
|
</> |
|
|
); |
|
|
); |
|
|