import { NDKEvent, NDKPrivateKeySigner } from "@nostr-dev-kit/ndk"; import { ArrowRightCircleIcon } from "@shared/icons/arrowRightCircle"; import { Link } from "@shared/link"; import { RelayContext } from "@shared/relayProvider"; import { User } from "@shared/user"; import { useActiveAccount } from "@stores/accounts"; import { dateToUnix } from "@utils/date"; import { useContext, useEffect } from "react"; import { navigate } from "vite-plugin-ssr/client/router"; export function Page() { const ndk = useContext(RelayContext); const [account, fetchAccount] = useActiveAccount((state: any) => [ state.account, state.fetch, ]); useEffect(() => { if (account === null) { fetchAccount(); } }, [fetchAccount]); const publish = async () => { try { const event = new NDKEvent(ndk); const signer = new NDKPrivateKeySigner(account.privkey); ndk.signer = signer; event.content = "Running Lume, fighting for better future, join us here: https://lume.nu"; event.created_at = dateToUnix(); event.pubkey = account.pubkey; event.kind = 1; event.tags = []; // publish event event.publish(); // redirect to home setTimeout( () => navigate("/", { overwriteLastHistoryEntry: true }), 2000, ); } catch (error) { console.log(error); } }; return (
You're a part of better future that we're fighting
If Lume gets your attention, please help us spread via button below
Running Lume, fighting for better future
join us here:{" "} https://lume.nu