From 83adfe39644c6a1fba72ae733547db3bab99f0a2 Mon Sep 17 00:00:00 2001 From: en Date: Fri, 21 Feb 2025 14:57:10 +0100 Subject: [PATCH] fix(notes): render video preview --- src/components/Notes/NoteRender.tsx | 7 +++++-- src/utils/url.ts | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/Notes/NoteRender.tsx b/src/components/Notes/NoteRender.tsx index da3d4d6..907eeba 100644 --- a/src/components/Notes/NoteRender.tsx +++ b/src/components/Notes/NoteRender.tsx @@ -7,7 +7,7 @@ import { BlogPreview } from './internal/BlogPreview' import { ModPreview } from './internal/ModPreview' import { NoteWrapper } from './internal/NoteWrapper' import { NIP05_REGEX } from 'nostr-tools/nip05' -import { isValidImageUrl, isValidUrl } from 'utils' +import { isValidImageUrl, isValidUrl, isValidVideoUrl } from 'utils' interface NoteRenderProps { content: string @@ -36,9 +36,12 @@ export const NoteRender = ({ content }: NoteRenderProps) => { const [href] = part.match(link) || [] if (href && isValidUrl(href)) { - // Image if (isValidImageUrl(href)) { + // Image return + } else if (isValidVideoUrl(href)) { + // Video + return