ready to show

This commit is contained in:
zmeyer44 2023-10-24 18:06:23 -04:00
parent a3c4f55388
commit 158500e80d
4 changed files with 37 additions and 11 deletions

View File

@ -72,14 +72,13 @@ export default function Header({ event }: { event: NDKEvent }) {
};
const location = getLocation();
const rawEvent = event.rawEvent();
const subscriptionsEnabled = !!getTagValues("subscriptions", rawEvent.tags);
const priceInBTC = parseFloat(getTagValues("price", rawEvent.tags) ?? "0");
const isMember =
currentUser &&
getTagsValues("p", rawEvent.tags).includes(currentUser.pubkey);
useEffect(() => {
if (!currentUser || !subscriptionsEnabled) return;
if (!currentUser || !false) return;
if (!isMember && !checkingPayment && !hasValidPayment) {
void handleCheckPayment();
}
@ -155,8 +154,8 @@ export default function Header({ event }: { event: NDKEvent }) {
<ProfileInfo pubkey={pubkey} />
</div>
</div>
<div className="flex flex-wrap items-center gap-3">
{!!currentUser && currentUser.pubkey === pubkey && (
<div className="flex flex-wrap items-center justify-end gap-3">
{/* {!!currentUser && currentUser.pubkey === pubkey && (
<>
<Button onClick={() => modal?.show(<CreateListEvent />)}>
Invite Users
@ -170,9 +169,37 @@ export default function Header({ event }: { event: NDKEvent }) {
Edit
</Button>
</>
)}
{subscriptionsEnabled &&
!isMember &&
)} */}
<Button
// onClick={() =>
// modal?.show(
// <ConfirmModal
// title={`Subscribe to ${title}`}
// onConfirm={handleSendZap}
// ctaBody={
// <>
// <span>Zap to Subscribe</span>
// <HiOutlineLightningBolt className="h-4 w-4" />
// </>
// }
// >
// <p className="text-muted-forground">
// {`Pay ${priceInBTC} BTC (${formatNumber(
// btcToSats(priceInBTC),
// )} sats) for year long access until ${formatDate(
// new Date(
// new Date().setFullYear(new Date().getFullYear() + 1),
// ),
// "MMM Do, YYYY",
// )}`}
// </p>
// </ConfirmModal>,
// )
// }
>
RSVP
</Button>
{/* {!isMember &&
(hasValidPayment ? (
<Button variant={"outline"}>Pending Sync</Button>
) : (
@ -207,7 +234,7 @@ export default function Header({ event }: { event: NDKEvent }) {
>
RSVP
</Button>
))}
))} */}
</div>
</div>
<div className="flex flex-col gap-x-6 gap-y-3 pt-1 @md:pt-2 @xl:flex-row">

View File

@ -65,7 +65,7 @@ export default function EventPage({
ids: noteIds,
}}
empty={() => (
<div className="pt-5 text-center text-muted-foreground">
<div className="py-5 text-center text-muted-foreground">
<p>No Announcements yet</p>
</div>
)}

View File

@ -127,7 +127,7 @@ export default function CreateCalendarEventModal() {
tags: tags,
kind: 31923,
};
if (confirm("end")) return;
const event = await createEvent(ndk, preEvent);
if (event) {
toast.success("Event Created!");

View File

@ -27,7 +27,6 @@ export async function createEvent(
) {
log("func", "createEvent");
try {
alert("at pub");
const pubkey = ndk.activeUser?.pubkey;
if (!pubkey) {
throw new Error("No public key provided!");