This commit is contained in:
Ren Amamiya
2023-06-27 20:53:52 +07:00
parent a29ef03198
commit 3fe601cfc6
20 changed files with 159 additions and 110 deletions

View File

@@ -17,7 +17,7 @@ export function Kind1({
{content.parsed}
</div>
{Array.isArray(content.images) && content.images.length ? (
<ImagePreview urls={content.images} />
<ImagePreview urls={content.images} truncate={truncate} />
) : (
<></>
)}

View File

@@ -57,7 +57,7 @@ export const MentionNote = memo(function MentionNote({ id }: { id: string }) {
Lume isn't fully support this kind in newsfeed
</p>
</div>
<div className="markdown">
<div className="select-text whitespace-pre-line break-words text-base text-zinc-100">
<p>{data.content}</p>
</div>
</div>

View File

@@ -71,7 +71,7 @@ export function Note({ event, block }: Note) {
time={event.created_at}
repost={isRepost}
/>
<div className="z-10 relative -mt-6 pl-[49px]">
<div className="relative -mt-6 pl-[49px]">
{renderContent}
{!isRepost && (
<NoteMetadata

View File

@@ -1,6 +1,9 @@
import { Image } from "@shared/image";
export function ImagePreview({ urls }: { urls: string[] }) {
export function ImagePreview({
urls,
truncate,
}: { urls: string[]; truncate?: boolean }) {
return (
<div className="mt-3 max-w-[420px] overflow-hidden">
<div className="flex flex-col gap-2">
@@ -10,7 +13,9 @@ export function ImagePreview({ urls }: { urls: string[] }) {
src={url}
fallback="https://void.cat/d/XTmrMkpid8DGLjv1AzdvcW"
alt="image"
className="h-auto w-full border border-zinc-800/50 rounded-lg object-cover"
className={`${
truncate ? "h-auto max-h-[300px]" : "h-auto"
} w-full border border-zinc-800/50 rounded-lg object-cover`}
/>
</div>
))}