Merge pull request 'profile fixes' (#18) from verbiricha/stream:profile into main

Reviewed-on: Kieran/stream#18
This commit is contained in:
Kieran 2023-07-01 17:40:50 +00:00
commit 05bf4cbfa6
3 changed files with 18 additions and 17 deletions

View File

@ -1,8 +1,8 @@
import { useMemo } from "react";
import {
RequestBuilder,
ReplaceableNoteStore,
FlatNoteStore,
ParameterizedReplaceableNoteStore,
NostrLink,
EventKind,
parseZap,
@ -24,20 +24,19 @@ export function useProfile(link: NostrLink, leaveOpen = false) {
return b;
}, [link, leaveOpen]);
const { data: streamsData } = useRequestBuilder<ReplaceableNoteStore>(
System,
ReplaceableNoteStore,
sub
);
const streams = Array.isArray(streamsData)
? streamsData
: streamsData
? [streamsData]
: [];
const { data: streamsData } =
useRequestBuilder<ParameterizedReplaceableNoteStore>(
System,
ParameterizedReplaceableNoteStore,
sub
);
const streams = streamsData ?? [];
const addresses = useMemo(() => {
return streams.map((e) => `${e.kind}:${e.pubkey}:${findTag(e, "d")}`);
if (streamsData) {
return streamsData.map((e) => `${e.kind}:${e.pubkey}:${findTag(e, "d")}`);
}
return [];
}, [streamsData]);
const zapsSub = useMemo(() => {

View File

@ -3,8 +3,11 @@
justify-content: center;
}
.profile-page .profile-container {
max-width: 620px;
@media (min-width: 768px) {
.profile-page .profile-container {
width: 620px;
}
}
.profile-page .profile-content {

View File

@ -69,8 +69,7 @@ export function ProfilePage() {
function goToLive() {
if (liveEvent) {
const d =
liveEvent.tags?.find((t: string[]) => t?.at(0) === "d")?.at(1) || "";
const d = findTag(liveEvent, "d") || "";
const naddr = encodeTLV(
NostrPrefix.Address,
d,