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:
Innei
2025-05-28 17:39:23 +08:00
parent a86ef8acdd
commit c0a2d10f4d
2 changed files with 2 additions and 1 deletions
@@ -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>