fix: restore the play icon in the search result card; closes #171

This commit is contained in:
Hossein Mehrabi 2023-09-06 19:34:24 +03:30
parent e534ecf1a0
commit d1c5ead6e0
No known key found for this signature in database
GPG Key ID: 45C04964191AFAA1
3 changed files with 12 additions and 12 deletions

View File

@ -25,12 +25,13 @@ export const PostCardCover: FC<PostCardCoverProps> = ({
{...props}
className={`post-card__cover-image ${props.className}`}
>
<ResponsiveImage {...imageProps} data={imageData} />
{playIcon && (
<Icon size="small">
<UnfilledPlayIcon />
</Icon>
)}
<ResponsiveImage {...imageProps} data={imageData}>
{playIcon && (
<Icon size="small">
<UnfilledPlayIcon />
</Icon>
)}
</ResponsiveImage>
</CustomLink>
)
}

View File

@ -464,10 +464,6 @@ PostCard.styles = {
align-self: end;
}
.post-card__cover-image button {
display: none;
}
&.top-post {
.post-card__title-text {
${lsdUtils.typography('h4')}

View File

@ -1,6 +1,6 @@
import styled from '@emotion/styled'
import Image, { ImageLoader, ImageProps } from 'next/image'
import { useState } from 'react'
import React, { useState } from 'react'
import { LPE } from '../../types/lpe.types'
export type ResponsiveImageProps = {
@ -24,7 +24,8 @@ export const ResponsiveImage = ({
fill = false,
nextImageProps,
className,
}: Props) => {
children,
}: React.PropsWithChildren<Props>) => {
const [loaded, setLoaded] = useState(false)
const lazyUrl = `${data.url}?blur=200&px=16&auto=format`
@ -57,9 +58,11 @@ export const ResponsiveImage = ({
>
<div>
<img src={lazyUrl} alt={data.alt} title={data.alt} />
{children}
</div>
<div className={imageProps.className}>
<Image {...imageProps} alt={data.alt} title={data.alt} />
{children}
</div>
</Container>
)