diff --git a/package-lock.json b/package-lock.json index 6e7c1d4c..938c2238 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "jumble-imwald", - "version": "21.0.2", + "version": "21.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jumble-imwald", - "version": "21.0.2", + "version": "21.1.0", "license": "MIT", "dependencies": { "@asciidoctor/core": "^3.0.4", diff --git a/package.json b/package.json index 2f3cead7..cafade31 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jumble-imwald", - "version": "21.0.2", + "version": "21.1.0", "description": "A user-friendly Nostr client focused on relay feed browsing and relay discovery, forked from Jumble", "private": true, "type": "module", diff --git a/src/components/KindFilter/index.tsx b/src/components/KindFilter/index.tsx index d8ca933e..d3ed999d 100644 --- a/src/components/KindFilter/index.tsx +++ b/src/components/KindFilter/index.tsx @@ -17,8 +17,6 @@ const KIND_1 = kinds.ShortTextNote const KIND_1111 = ExtendedKind.COMMENT const KIND_FILTER_OPTIONS = [ - { kindGroup: [kinds.LongFormArticle], label: 'Articles' }, - { kindGroup: [ExtendedKind.WIKI_ARTICLE, ExtendedKind.WIKI_ARTICLE_MARKDOWN], label: 'Wiki Articles' }, { kindGroup: [kinds.Highlights], label: 'Highlights' }, { kindGroup: [ExtendedKind.POLL], label: 'Polls' }, { kindGroup: [ExtendedKind.ZAP_POLL], label: 'Zap polls' }, diff --git a/src/components/Profile/ProfileFeedWithPins.tsx b/src/components/Profile/ProfileFeedWithPins.tsx index 1cdfa05a..faf31e74 100644 --- a/src/components/Profile/ProfileFeedWithPins.tsx +++ b/src/components/Profile/ProfileFeedWithPins.tsx @@ -1,7 +1,7 @@ import NoteCard from '@/components/NoteCard' import ProfileSearchBar from '@/components/ui/ProfileSearchBar' import { Skeleton } from '@/components/ui/skeleton' -import { ExtendedKind, PROFILE_FEED_KINDS } from '@/constants' +import { ExtendedKind, PROFILE_POSTS_TAB_KINDS, PROFILE_PUBLICATIONS_TAB_KINDS } from '@/constants' import { isReplyNoteEvent } from '@/lib/event' import { getZapInfoFromEvent } from '@/lib/event-metadata' import { useProfilePins } from '@/hooks/useProfilePins' @@ -54,6 +54,7 @@ const ProfileFeedWithPins = forwardRef<{ refresh: () => void }, { pubkey: string return next.sort((a, b) => a - b) }, [showKinds]) const hideReplies = useHideRepliesLikeMainFeed() + const publicationsKindSet = useMemo(() => new Set(PROFILE_PUBLICATIONS_TAB_KINDS), []) const [searchQuery, setSearchQuery] = useState('') const [isRefreshing, setIsRefreshing] = useState(false) const [showCount, setShowCount] = useState(INITIAL_SHOW_COUNT) @@ -76,10 +77,12 @@ const ProfileFeedWithPins = forwardRef<{ refresh: () => void }, { pubkey: string const cacheKey = useMemo(() => `${pubkey}-profile-unified-${zapReplyThreshold}`, [pubkey, zapReplyThreshold]) + const postsTabKinds = useMemo(() => [...PROFILE_POSTS_TAB_KINDS], []) + const { events: timelineEvents, isLoading: loadingTimeline, refresh: refreshTimeline } = useProfileTimeline({ pubkey, cacheKey, - kinds: PROFILE_FEED_KINDS, + kinds: postsTabKinds, limit: 200, filterPredicate }) @@ -160,8 +163,11 @@ const ProfileFeedWithPins = forwardRef<{ refresh: () => void }, { pubkey: string ) const filteredPins = useMemo( - () => applySearch(pinEvents).filter((e) => !isEventDeleted(e)), - [pinEvents, applySearch, isEventDeleted] + () => + applySearch(pinEvents) + .filter((e) => !isEventDeleted(e)) + .filter((e) => !publicationsKindSet.has(e.kind)), + [pinEvents, applySearch, isEventDeleted, publicationsKindSet] ) const filteredRest = useMemo( () => diff --git a/src/components/Profile/ProfilePublicationsFeed.tsx b/src/components/Profile/ProfilePublicationsFeed.tsx new file mode 100644 index 00000000..2641463d --- /dev/null +++ b/src/components/Profile/ProfilePublicationsFeed.tsx @@ -0,0 +1,44 @@ +import ProfileSearchBar from '@/components/ui/ProfileSearchBar' +import { PROFILE_PUBLICATIONS_TAB_KINDS } from '@/constants' +import { forwardRef, useMemo, useState } from 'react' +import { useTranslation } from 'react-i18next' +import ProfileTimeline from './ProfileTimeline' + +const ProfilePublicationsFeed = forwardRef<{ refresh: () => void }, { pubkey: string }>(({ pubkey }, ref) => { + const { t } = useTranslation() + const [searchQuery, setSearchQuery] = useState('') + + const kindsList = useMemo(() => [...PROFILE_PUBLICATIONS_TAB_KINDS], []) + const cacheKey = useMemo(() => `${pubkey}-profile-publications`, [pubkey]) + + const getKindLabel = (_kindValue: string) => t('articles and publications') + + return ( +