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";
import { Input } from "@/components/ui/input";
import { commandDialogAtom } from "./CommandDialog";
import { useAtom } from "jotai";
import { Button } from "@/components/ui/button";

View File

@ -43,7 +43,7 @@ export default function LinkCard({
}, [url]);
if (metadata) {
return (
<a href={url} target="_blank" rel="nonreferrer">
<a href={url} target="_blank" rel="nonreferrer" className="w-full">
<Card className={cn("group", className)}>
{metadata.image && (
<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 { useRouter } from "next/navigation";
import { log } from "@/lib/utils";
import { follow } from "@/lib/actions/create";
const CreateSubscriptionTierSchema = z.object({
title: z.string(),
@ -56,7 +57,7 @@ export default function CreateSubscriptionTier() {
tags.push(["price", satsToBtc(data.price).toString(), "btc", "year"]);
}
const event = await createEvent(ndk!, {
content: "[]",
content: "",
kind: 30044,
tags: tags,
});
@ -73,17 +74,13 @@ export default function CreateSubscriptionTier() {
},
}),
)
.then((savedSigner) => {
log("info", "savedSigner", savedSigner.toString());
currentUser.follow(
new NDKUser({
hexpubkey: savedSigner.pubkey,
}),
);
return updateList(ndk!, event.rawEvent(), [
.then(async (savedSigner) => {
await updateList(ndk!, event.rawEvent(), [
["delegate", savedSigner.pubkey],
]);
return savedSigner.pubkey;
})
.then((delegate) => follow(ndk!, currentUser, delegate))
.catch((err) => console.log("Error creating delegate"));
}
// getSubscriptionTiers(currentUser!.hexpubkey);