feat: mobile and tablet styles

This commit is contained in:
Alejandro Gomez
2023-06-25 08:22:50 +02:00
parent 9fd8b65bdf
commit 803d0910af
14 changed files with 430 additions and 132 deletions

View File

@ -1,5 +1,10 @@
import { useMemo } from "react";
import { NostrPrefix, RequestBuilder, ReplaceableNoteStore, NostrLink } from "@snort/system";
import {
NostrPrefix,
RequestBuilder,
ReplaceableNoteStore,
NostrLink,
} from "@snort/system";
import { useRequestBuilder } from "@snort/system-react";
import { System } from "index";
@ -8,8 +13,8 @@ export default function useEventFeed(link: NostrLink, leaveOpen = false) {
const sub = useMemo(() => {
const b = new RequestBuilder(`event:${link.id.slice(0, 12)}`);
b.withOptions({
leaveOpen
})
leaveOpen,
});
if (link.type === NostrPrefix.Address) {
const f = b.withFilter().tag("d", [link.id]);
if (link.author) {
@ -21,14 +26,18 @@ export default function useEventFeed(link: NostrLink, leaveOpen = false) {
} else {
const f = b.withFilter().ids([link.id]);
if (link.relays) {
link.relays.slice(0, 2).forEach(r => f.relay(r));
link.relays.slice(0, 2).forEach((r) => f.relay(r));
}
if (link.author) {
f.authors([link.author]);
}
}
return b;
}, [link]);
}, [link, leaveOpen]);
return useRequestBuilder<ReplaceableNoteStore>(System, ReplaceableNoteStore, sub);
return useRequestBuilder<ReplaceableNoteStore>(
System,
ReplaceableNoteStore,
sub
);
}