import { commands } from "@/commands.gen"; import { Spinner } from "@/components"; import { createFileRoute } from "@tanstack/react-router"; import { message } from "@tauri-apps/plugin-dialog"; import { useState, useTransition } from "react"; export const Route = createFileRoute("/columns/_layout/create-newsfeed/f2f")({ component: Screen, }); function Screen() { const { queryClient } = Route.useRouteContext(); const { redirect, label, account } = Route.useSearch(); const [npub, setNpub] = useState(""); const [isPending, startTransition] = useTransition(); const navigate = Route.useNavigate(); const submit = async () => { startTransition(async () => { if (!npub.startsWith("npub1")) { await message("You must enter a valid npub.", { title: "Create Newsfeed", kind: "info", }); return; } const res = await commands.copyFriend(npub); if (res.status === "ok") { await queryClient.invalidateQueries({ queryKey: [label, account] }); navigate({ to: redirect }); } else { await message(res.error, { title: "Create Newsfeed", kind: "error", }); return; } }); }; return (
You already have a friend on Nostr?
Instead of building the timeline by yourself.
Just enter your friend's{" "} npub.
You will have the same experience as your friend. Of course, you always can edit your network later.