diff --git a/README.md b/README.md index 9799f1cf3..c99c38e34 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ I would recommend you use a browser extension like [Alby](https://getalby.com/) ## Running with docker ```bash -docker run --rm -p 8080:80 ghcr.io/hzrd149/nostrudel +docker run --rm -p 8080:80 ghcr.io/hzrd149/nostrudel:master ``` ## Running locally diff --git a/src/components/embed-event/event-types/embedded-article.tsx b/src/components/embed-event/event-types/embedded-article.tsx index 628ffa36e..7b4825b61 100644 --- a/src/components/embed-event/event-types/embedded-article.tsx +++ b/src/components/embed-event/event-types/embedded-article.tsx @@ -1,5 +1,5 @@ import { useRef } from "react"; -import { Card, CardProps, Flex, Image, LinkBox, LinkOverlay, Tag, Text } from "@chakra-ui/react"; +import { Box, Card, CardBody, CardProps, Flex, Image, LinkBox, LinkOverlay, Tag, Text } from "@chakra-ui/react"; import { getArticleImage, @@ -28,29 +28,39 @@ export default function EmbeddedArticle({ article, ...props }: Omit - - + + {image && ( + + )} + + {image && ( + {title} + )} + - - {title} - - by: - - - | - + + - {summary} - - {article.tags - .filter((t) => t[0] === "t") - .map(([_, hashtag]) => ( - {hashtag} - ))} - - - {image && {title}} + + {title} + + {summary} + {article.tags + .filter((t) => t[0] === "t") + .map(([_, hashtag]) => ( + + #{hashtag} + + ))} + ); } diff --git a/src/views/search/index.tsx b/src/views/search/index.tsx index 0a3f5b5e9..1bfdd1e99 100644 --- a/src/views/search/index.tsx +++ b/src/views/search/index.tsx @@ -29,6 +29,7 @@ import trustedUserStatsService, { NostrBandUserStats } from "../../services/trus import VerticalPageLayout from "../../components/vertical-page-layout"; import User01 from "../../components/icons/user-01"; import GenericNoteTimeline from "../../components/timeline-page/generic-note-timeline"; +import Feather from "../../components/icons/feather"; function ProfileResult({ profile }: { profile: NostrEvent }) { const metadata = parseKind0Event(profile); @@ -120,6 +121,25 @@ function NoteSearchResults({ search }: { search: string }) { ); } +function ArticleSearchResults({ search }: { search: string }) { + const searchRelays = useRelaySelectionRelays(); + + const timeline = useTimelineLoader( + `${search}-article-search`, + searchRelays, + { search: search || "", kinds: [Kind.Article] }, + { enabled: !!search }, + ); + + const callback = useTimelineCurserIntersectionCallback(timeline); + + return ( + + + + ); +} + export function SearchPage() { const navigate = useNavigate(); const qrScannerModal = useDisclosure(); @@ -168,7 +188,18 @@ export function SearchPage() { handleSearchText(searchInput); }; - const SearchResults = type === "users" ? ProfileSearchResults : NoteSearchResults; + let SearchResults = ProfileSearchResults; + switch (type) { + case "users": + SearchResults = ProfileSearchResults; + break; + case "notes": + SearchResults = NoteSearchResults; + break; + case "articles": + SearchResults = ArticleSearchResults; + break; + } return ( @@ -203,11 +234,18 @@ export function SearchPage() { > Notes + - + {search ? ( ) : (