This commit is contained in:
zmeyer44 2023-10-20 18:44:41 -04:00
parent d30e325ec4
commit 121cf57652
3 changed files with 7 additions and 11 deletions

View File

@ -1,6 +1,5 @@
"use client"; "use client";
import { Input } from "@/components/ui/input";
import { commandDialogAtom } from "./CommandDialog"; import { commandDialogAtom } from "./CommandDialog";
import { useAtom } from "jotai"; import { useAtom } from "jotai";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";

View File

@ -43,7 +43,7 @@ export default function LinkCard({
}, [url]); }, [url]);
if (metadata) { if (metadata) {
return ( return (
<a href={url} target="_blank" rel="nonreferrer"> <a href={url} target="_blank" rel="nonreferrer" className="w-full">
<Card className={cn("group", className)}> <Card className={cn("group", className)}>
{metadata.image && ( {metadata.image && (
<div className="max-h-[100px] overflow-hidden rounded-t-md"> <div className="max-h-[100px] overflow-hidden rounded-t-md">

View File

@ -14,6 +14,7 @@ import { NDKList, NDKUser } from "@nostr-dev-kit/ndk";
import { saveEphemeralSigner } from "@/lib/actions/ephemeral"; import { saveEphemeralSigner } from "@/lib/actions/ephemeral";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import { log } from "@/lib/utils"; import { log } from "@/lib/utils";
import { follow } from "@/lib/actions/create";
const CreateSubscriptionTierSchema = z.object({ const CreateSubscriptionTierSchema = z.object({
title: z.string(), title: z.string(),
@ -56,7 +57,7 @@ export default function CreateSubscriptionTier() {
tags.push(["price", satsToBtc(data.price).toString(), "btc", "year"]); tags.push(["price", satsToBtc(data.price).toString(), "btc", "year"]);
} }
const event = await createEvent(ndk!, { const event = await createEvent(ndk!, {
content: "[]", content: "",
kind: 30044, kind: 30044,
tags: tags, tags: tags,
}); });
@ -73,17 +74,13 @@ export default function CreateSubscriptionTier() {
}, },
}), }),
) )
.then((savedSigner) => { .then(async (savedSigner) => {
log("info", "savedSigner", savedSigner.toString()); await updateList(ndk!, event.rawEvent(), [
currentUser.follow(
new NDKUser({
hexpubkey: savedSigner.pubkey,
}),
);
return updateList(ndk!, event.rawEvent(), [
["delegate", savedSigner.pubkey], ["delegate", savedSigner.pubkey],
]); ]);
return savedSigner.pubkey;
}) })
.then((delegate) => follow(ndk!, currentUser, delegate))
.catch((err) => console.log("Error creating delegate")); .catch((err) => console.log("Error creating delegate"));
} }
// getSubscriptionTiers(currentUser!.hexpubkey); // getSubscriptionTiers(currentUser!.hexpubkey);