mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-19 22:15:06 +00:00
remove duplicate zap threads components, consolidate it all into the parent details index page
This commit is contained in:
parent
6ed7dda3ad
commit
833ebf3475
@ -327,26 +327,6 @@ const DocumentDetails = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full mt-4">{renderPaymentMessage()}</div>
|
<div className="w-full mt-4">{renderPaymentMessage()}</div>
|
||||||
{nAddress && (
|
|
||||||
<div className="mt-8">
|
|
||||||
{!paidResource || decryptedContent || session?.user?.role?.subscribed ? (
|
|
||||||
<ZapThreadsWrapper
|
|
||||||
anchor={nAddress}
|
|
||||||
user={session?.user ? nsec || npub : null}
|
|
||||||
relays={appConfig.defaultRelayUrls.join(',')}
|
|
||||||
disable="zaps"
|
|
||||||
isAuthorized={true}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<div className="text-center p-4 bg-gray-800/50 rounded-lg">
|
|
||||||
<p className="text-gray-400">
|
|
||||||
Comments are only available to content purchasers, subscribers, and the content
|
|
||||||
creator.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
{renderContent()}
|
{renderContent()}
|
||||||
</div>
|
</div>
|
||||||
|
@ -333,26 +333,6 @@ const VideoDetails = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full flex justify-start mt-4">{renderPaymentMessage()}</div>
|
<div className="w-full flex justify-start mt-4">{renderPaymentMessage()}</div>
|
||||||
{nAddress && (
|
|
||||||
<div className="mt-8">
|
|
||||||
{!paidResource || decryptedContent || session?.user?.role?.subscribed ? (
|
|
||||||
<ZapThreadsWrapper
|
|
||||||
anchor={nAddress}
|
|
||||||
user={session?.user ? nsec || npub : null}
|
|
||||||
relays={appConfig.defaultRelayUrls.join(',')}
|
|
||||||
disable="zaps"
|
|
||||||
isAuthorized={true}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<div className="text-center p-4 bg-gray-800/50 rounded-lg">
|
|
||||||
<p className="text-gray-400">
|
|
||||||
Comments are only available to content purchasers, subscribers, and the content
|
|
||||||
creator.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -195,6 +195,9 @@ const Details = () => {
|
|||||||
|
|
||||||
const DetailComponent = getDetailComponent();
|
const DetailComponent = getDetailComponent();
|
||||||
|
|
||||||
|
const isAuthorized =
|
||||||
|
!event.price || decryptedContent || session?.user?.role?.subscribed || authorView;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<DetailComponent
|
<DetailComponent
|
||||||
@ -213,31 +216,23 @@ const Details = () => {
|
|||||||
handlePaymentError={handlePaymentError}
|
handlePaymentError={handlePaymentError}
|
||||||
authorView={authorView}
|
authorView={authorView}
|
||||||
/>
|
/>
|
||||||
{nAddress !== null && (nsec || npub) ? (
|
{nAddress !== null && isAuthorized ? (
|
||||||
<div className="px-4">
|
<div className="px-4">
|
||||||
<ZapThreadsWrapper
|
<ZapThreadsWrapper
|
||||||
anchor={nAddress}
|
anchor={nAddress}
|
||||||
user={nsec || npub || null}
|
user={nsec || npub || null}
|
||||||
relays="wss://nos.lol/, wss://relay.damus.io/, wss://relay.snort.social/, wss://relay.nostr.band/, wss://relay.primal.net/, wss://nostrue.com/, wss://purplerelay.com/, wss://relay.devs.tools/"
|
relays="wss://nos.lol/, wss://relay.damus.io/, wss://relay.snort.social/, wss://relay.nostr.band/, wss://relay.primal.net/, wss://nostrue.com/, wss://purplerelay.com/, wss://relay.devs.tools/"
|
||||||
disable="zaps"
|
disable="zaps"
|
||||||
isAuthorized={
|
isAuthorized={isAuthorized}
|
||||||
!event.price || decryptedContent || session?.user?.role?.subscribed || authorView
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : nAddress !== null ? (
|
) : (
|
||||||
<div className="px-4">
|
<div className="text-center p-4 mx-4 bg-gray-800/50 rounded-lg">
|
||||||
<ZapThreadsWrapper
|
<p className="text-gray-400">
|
||||||
anchor={nAddress}
|
Comments are only available to content purchasers, subscribers, and the content creator.
|
||||||
user={npub}
|
</p>
|
||||||
relays="wss://nos.lol/, wss://relay.damus.io/, wss://relay.snort.social/, wss://relay.nostr.band/, wss://relay.primal.net/, wss://nostrue.com/, wss://purplerelay.com/, wss://relay.devs.tools/"
|
|
||||||
disable="zaps"
|
|
||||||
isAuthorized={
|
|
||||||
!event.price || decryptedContent || session?.user?.role?.subscribed || authorView
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user