feat: replace MediaGallery with inline media rendering in SocialMediaLayout
This commit is contained in:
+14
-2
@@ -2,8 +2,8 @@ import { useEntry } from "@follow/store/entry/hooks"
|
||||
import { useFeedById } from "@follow/store/feed/hooks"
|
||||
import { cn } from "@follow/utils/utils"
|
||||
|
||||
import { Media } from "~/components/ui/media/Media"
|
||||
import { readableContentMaxWidthClassName } from "~/constants/ui"
|
||||
import { MediaGallery } from "~/modules/entry-column/Items/media-gallery"
|
||||
|
||||
import { AuthorHeader } from "./shared/AuthorHeader"
|
||||
import { ContentBody } from "./shared/ContentBody"
|
||||
@@ -44,7 +44,19 @@ export const SocialMediaLayout: React.FC<SocialMediaLayoutProps> = ({
|
||||
/>
|
||||
|
||||
{/* Media gallery */}
|
||||
{!noMedia && <MediaGallery entryId={entryId} />}
|
||||
{entry.media &&
|
||||
entry.media.length > 0 &&
|
||||
!noMedia &&
|
||||
entry.media.map((m) => (
|
||||
<div key={m.url} className="mt-4 flex justify-center">
|
||||
<Media
|
||||
src={m.url}
|
||||
type={m.type}
|
||||
previewImageUrl={m.preview_image_url}
|
||||
blurhash={m.blurhash}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user