diff --git a/cypress/e2e/profile.cy.ts b/cypress/e2e/profile.cy.ts index 1a8108880..0001f5024 100644 --- a/cypress/e2e/profile.cy.ts +++ b/cypress/e2e/profile.cy.ts @@ -1,5 +1,5 @@ describe("Profile view", () => { - it("should load user on single relay", () => { + it("should load a rss feed profile", () => { cy.visit( "#/u/nprofile1qqsp6hxqjatvxtesgszs8aee0fcjccxa3ef3mzjva4uv2yr5lucp6jcpzemhxue69uhhyumnd3shjtnwdaehgu3wd4hk2s8c5un" ); @@ -7,4 +7,10 @@ describe("Profile view", () => { cy.contains("fjsmu"); cy.contains("https://rsshub.app/pixiv/user/7569500@rsslay.nostr.moe"); }); + + it("should load a rss feed fiatjef", () => { + cy.visit("#/u/npub1l2vyh47mk2p0qlsku7hg0vn29faehy9hy34ygaclpn66ukqp3afqutajft"); + + cy.contains("npub1l2vyh...3afqutajft"); + }); }); diff --git a/src/services/user-trusted-stats.ts b/src/services/user-trusted-stats.ts index 398a353ab..e6735ee70 100644 --- a/src/services/user-trusted-stats.ts +++ b/src/services/user-trusted-stats.ts @@ -31,7 +31,7 @@ export type NostrBandProfileStats = { report_pubkey_count: number; mute_pubkey_count: number; followers_pubkey_count: number; - zaps_sent: { + zaps_sent?: { count: number; zapper_count: number; target_event_count: number; @@ -43,19 +43,7 @@ export type NostrBandProfileStats = { avg_msats: number; median_msats: number; }; - zaps_received: { - count: number; - zapper_count: number; - target_event_count: number; - target_pubkey_count: number; - provider_count: number; - msats: number; - min_msats: number; - max_msats: number; - avg_msats: number; - median_msats: number; - }; - zaps_processed: { + zaps_received?: { count: number; zapper_count: number; target_event_count: number; diff --git a/src/views/user/about.tsx b/src/views/user/about.tsx index e620627ee..963fd2695 100644 --- a/src/views/user/about.tsx +++ b/src/views/user/about.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { useNavigate, useOutletContext, Link as RouterLink } from "react-router-dom"; +import { useNavigate, useOutletContext } from "react-router-dom"; import moment from "moment"; import { Accordion, @@ -13,7 +13,6 @@ import { Image, Link, Stat, - StatArrow, StatGroup, StatHelpText, StatLabel, @@ -21,6 +20,7 @@ import { Text, useDisclosure, } from "@chakra-ui/react"; +import { useAsync } from "react-use"; import { useAdditionalRelayContext } from "../../providers/additional-relay-context"; import { useUserMetadata } from "../../hooks/use-user-metadata"; import { embedNostrLinks, renderGenericUrl } from "../../components/embed-types"; @@ -35,10 +35,8 @@ import { QrIconButton } from "./components/share-qr-button"; import { UserDnsIdentityIcon } from "../../components/user-dns-identity-icon"; import { useUserContacts } from "../../hooks/use-user-contacts"; import { convertTimestampToDate } from "../../helpers/date"; -import { useAsync } from "react-use"; import userTrustedStatsService from "../../services/user-trusted-stats"; import { readablizeSats } from "../../helpers/bolt11"; -import { useSharableProfileId } from "../../hooks/use-shareable-profile-id"; function buildDescriptionContent(description: string) { let content: EmbedableContent = [description.trim()]; @@ -153,9 +151,7 @@ export default function UserAboutTab() { Following - - {contacts ? readablizeSats(contacts.contacts.length) : "Unknown"} - + {contacts ? readablizeSats(contacts.contacts.length) : "Unknown"} {contacts && ( Updated {moment(convertTimestampToDate(contacts.created_at)).fromNow()} )} @@ -165,21 +161,17 @@ export default function UserAboutTab() { <> Followers - - {readablizeSats(stats.followers_pubkey_count)} - + {readablizeSats(stats.followers_pubkey_count) || 0} Published Notes - - {readablizeSats(stats.pub_post_count)} - + {readablizeSats(stats.pub_post_count) || 0} Reactions - {readablizeSats(stats.pub_reaction_count)} + {readablizeSats(stats.pub_reaction_count) || 0} )} @@ -187,7 +179,7 @@ export default function UserAboutTab() { - {stats && ( + {(stats?.zaps_sent || stats?.zaps_received) && (

@@ -199,39 +191,47 @@ export default function UserAboutTab() {

- - Zap Sent - {stats.zaps_sent.count} - - - Total Sats Sent - {readablizeSats(stats.zaps_sent.msats / 1000)} - - - Avg Zap Sent - {readablizeSats(stats.zaps_sent.avg_msats / 1000)} - - - Biggest Zap Sent - {readablizeSats(stats.zaps_sent.max_msats / 1000)} - + {stats.zaps_sent && ( + <> + + Zap Sent + {stats.zaps_sent.count} + + + Total Sats Sent + {readablizeSats(stats.zaps_sent.msats / 1000)} + + + Avg Zap Sent + {readablizeSats(stats.zaps_sent.avg_msats / 1000)} + + + Biggest Zap Sent + {readablizeSats(stats.zaps_sent.max_msats / 1000)} + + + )} - - Zap Received - {stats.zaps_received.count} - - - Total Sats Received - {readablizeSats(stats.zaps_received.msats / 1000)} - - - Avg Zap Received - {readablizeSats(stats.zaps_received.avg_msats / 1000)} - - - Biggest Zap Received - {readablizeSats(stats.zaps_received.max_msats / 1000)} - + {stats.zaps_received && ( + <> + + Zap Received + {stats.zaps_received.count} + + + Total Sats Received + {readablizeSats(stats.zaps_received.msats / 1000)} + + + Avg Zap Received + {readablizeSats(stats.zaps_received.avg_msats / 1000)} + + + Biggest Zap Received + {readablizeSats(stats.zaps_received.max_msats / 1000)} + + + )} Stats from{" "} diff --git a/src/views/user/followers.tsx b/src/views/user/followers.tsx index fbae770be..fbb0c2144 100644 --- a/src/views/user/followers.tsx +++ b/src/views/user/followers.tsx @@ -37,6 +37,7 @@ const UserFollowersTab = () => { itemKey={(i, d) => d[i]} width="100%" height={height} + overscanCount={10} > {FollowerItem} diff --git a/src/views/user/following.tsx b/src/views/user/following.tsx index 381d2bff1..3884bf753 100644 --- a/src/views/user/following.tsx +++ b/src/views/user/following.tsx @@ -36,6 +36,7 @@ export default function UserFollowingTab() { itemKey={(i, d) => d.contacts[i]} width="100%" height={height} + overscanCount={10} > {ContactItem}