ready to show
This commit is contained in:
parent
a3c4f55388
commit
158500e80d
@ -72,14 +72,13 @@ export default function Header({ event }: { event: NDKEvent }) {
|
|||||||
};
|
};
|
||||||
const location = getLocation();
|
const location = getLocation();
|
||||||
const rawEvent = event.rawEvent();
|
const rawEvent = event.rawEvent();
|
||||||
const subscriptionsEnabled = !!getTagValues("subscriptions", rawEvent.tags);
|
|
||||||
const priceInBTC = parseFloat(getTagValues("price", rawEvent.tags) ?? "0");
|
const priceInBTC = parseFloat(getTagValues("price", rawEvent.tags) ?? "0");
|
||||||
const isMember =
|
const isMember =
|
||||||
currentUser &&
|
currentUser &&
|
||||||
getTagsValues("p", rawEvent.tags).includes(currentUser.pubkey);
|
getTagsValues("p", rawEvent.tags).includes(currentUser.pubkey);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!currentUser || !subscriptionsEnabled) return;
|
if (!currentUser || !false) return;
|
||||||
if (!isMember && !checkingPayment && !hasValidPayment) {
|
if (!isMember && !checkingPayment && !hasValidPayment) {
|
||||||
void handleCheckPayment();
|
void handleCheckPayment();
|
||||||
}
|
}
|
||||||
@ -155,8 +154,8 @@ export default function Header({ event }: { event: NDKEvent }) {
|
|||||||
<ProfileInfo pubkey={pubkey} />
|
<ProfileInfo pubkey={pubkey} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-wrap items-center gap-3">
|
<div className="flex flex-wrap items-center justify-end gap-3">
|
||||||
{!!currentUser && currentUser.pubkey === pubkey && (
|
{/* {!!currentUser && currentUser.pubkey === pubkey && (
|
||||||
<>
|
<>
|
||||||
<Button onClick={() => modal?.show(<CreateListEvent />)}>
|
<Button onClick={() => modal?.show(<CreateListEvent />)}>
|
||||||
Invite Users
|
Invite Users
|
||||||
@ -170,9 +169,37 @@ export default function Header({ event }: { event: NDKEvent }) {
|
|||||||
Edit
|
Edit
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
)}
|
)} */}
|
||||||
{subscriptionsEnabled &&
|
<Button
|
||||||
!isMember &&
|
// 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 ? (
|
(hasValidPayment ? (
|
||||||
<Button variant={"outline"}>Pending Sync</Button>
|
<Button variant={"outline"}>Pending Sync</Button>
|
||||||
) : (
|
) : (
|
||||||
@ -207,7 +234,7 @@ export default function Header({ event }: { event: NDKEvent }) {
|
|||||||
>
|
>
|
||||||
RSVP
|
RSVP
|
||||||
</Button>
|
</Button>
|
||||||
))}
|
))} */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col gap-x-6 gap-y-3 pt-1 @md:pt-2 @xl:flex-row">
|
<div className="flex flex-col gap-x-6 gap-y-3 pt-1 @md:pt-2 @xl:flex-row">
|
||||||
|
@ -65,7 +65,7 @@ export default function EventPage({
|
|||||||
ids: noteIds,
|
ids: noteIds,
|
||||||
}}
|
}}
|
||||||
empty={() => (
|
empty={() => (
|
||||||
<div className="pt-5 text-center text-muted-foreground">
|
<div className="py-5 text-center text-muted-foreground">
|
||||||
<p>No Announcements yet</p>
|
<p>No Announcements yet</p>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
@ -127,7 +127,7 @@ export default function CreateCalendarEventModal() {
|
|||||||
tags: tags,
|
tags: tags,
|
||||||
kind: 31923,
|
kind: 31923,
|
||||||
};
|
};
|
||||||
|
if (confirm("end")) return;
|
||||||
const event = await createEvent(ndk, preEvent);
|
const event = await createEvent(ndk, preEvent);
|
||||||
if (event) {
|
if (event) {
|
||||||
toast.success("Event Created!");
|
toast.success("Event Created!");
|
||||||
|
@ -27,7 +27,6 @@ export async function createEvent(
|
|||||||
) {
|
) {
|
||||||
log("func", "createEvent");
|
log("func", "createEvent");
|
||||||
try {
|
try {
|
||||||
alert("at pub");
|
|
||||||
const pubkey = ndk.activeUser?.pubkey;
|
const pubkey = ndk.activeUser?.pubkey;
|
||||||
if (!pubkey) {
|
if (!pubkey) {
|
||||||
throw new Error("No public key provided!");
|
throw new Error("No public key provided!");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user