mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-19 14:05: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
src
@ -327,26 +327,6 @@ const DocumentDetails = ({
|
||||
</div>
|
||||
</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>
|
||||
{renderContent()}
|
||||
</div>
|
||||
|
@ -333,26 +333,6 @@ const VideoDetails = ({
|
||||
</div>
|
||||
</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>
|
||||
);
|
||||
|
@ -195,6 +195,9 @@ const Details = () => {
|
||||
|
||||
const DetailComponent = getDetailComponent();
|
||||
|
||||
const isAuthorized =
|
||||
!event.price || decryptedContent || session?.user?.role?.subscribed || authorView;
|
||||
|
||||
return (
|
||||
<>
|
||||
<DetailComponent
|
||||
@ -213,31 +216,23 @@ const Details = () => {
|
||||
handlePaymentError={handlePaymentError}
|
||||
authorView={authorView}
|
||||
/>
|
||||
{nAddress !== null && (nsec || npub) ? (
|
||||
{nAddress !== null && isAuthorized ? (
|
||||
<div className="px-4">
|
||||
<ZapThreadsWrapper
|
||||
anchor={nAddress}
|
||||
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/"
|
||||
disable="zaps"
|
||||
isAuthorized={
|
||||
!event.price || decryptedContent || session?.user?.role?.subscribed || authorView
|
||||
}
|
||||
isAuthorized={isAuthorized}
|
||||
/>
|
||||
</div>
|
||||
) : nAddress !== null ? (
|
||||
<div className="px-4">
|
||||
<ZapThreadsWrapper
|
||||
anchor={nAddress}
|
||||
user={npub}
|
||||
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 className="text-center p-4 mx-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>
|
||||
) : null}
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user