refactor: simplify Media component rendering and enhance DiscoverFeedCard styling
- Removed the unnecessary key prop from the Media component to streamline rendering. - Added mediaContainerClassName to the FeedCardMediaThumbnail for improved styling consistency. Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
@@ -327,7 +327,7 @@ const MediaImpl: FC<MediaProps> = ({
|
||||
)
|
||||
}
|
||||
|
||||
export const Media: FC<MediaProps> = memo((props) => <MediaImpl {...props} key={props.src} />)
|
||||
export const Media: FC<MediaProps> = memo((props) => <MediaImpl {...props} />)
|
||||
|
||||
const FallbackMedia: FC<MediaProps> = ({ type, mediaContainerClassName, className, ...props }) => (
|
||||
<div className={className} style={props.style}>
|
||||
|
||||
@@ -223,6 +223,7 @@ const FeedCardMediaThumbnail: FC<{
|
||||
type={entry.media[0].type}
|
||||
previewImageUrl={entry.media[0].preview_image_url}
|
||||
className="size-full object-cover"
|
||||
mediaContainerClassName="size-full object-cover"
|
||||
/>
|
||||
<div className="absolute inset-0 bg-gradient-to-t from-black/5 to-transparent opacity-0 transition-opacity duration-200 group-hover:opacity-100" />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user