mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-06 18:31:00 +00:00
Add additional links to video and document details pages, fix link to edit
This commit is contained in:
parent
35a6679023
commit
73e5ac55d2
@ -51,14 +51,6 @@ const DocumentDetails = ({ processedEvent, topics, title, summary, image, price,
|
|||||||
}
|
}
|
||||||
}, [processedEvent.d, isLesson]);
|
}, [processedEvent.d, isLesson]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
console.log("authorView", authorView);
|
|
||||||
}, [authorView]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
console.log("author", author);
|
|
||||||
}, [author]);
|
|
||||||
|
|
||||||
const handleDelete = async () => {
|
const handleDelete = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.delete(`/api/resources/${processedEvent.d}`);
|
const response = await axios.delete(`/api/resources/${processedEvent.d}`);
|
||||||
@ -155,6 +147,13 @@ const DocumentDetails = ({ processedEvent, topics, title, summary, image, price,
|
|||||||
{(summary)?.split('\n').map((line, index) => (
|
{(summary)?.split('\n').map((line, index) => (
|
||||||
<p key={index}>{line}</p>
|
<p key={index}>{line}</p>
|
||||||
))}
|
))}
|
||||||
|
{processedEvent?.additionalLinks && processedEvent?.additionalLinks.length > 0 && (
|
||||||
|
processedEvent?.additionalLinks.map((link, index) => (
|
||||||
|
<a key={index} href={link} target="_blank" rel="noopener noreferrer">
|
||||||
|
{link}
|
||||||
|
</a>
|
||||||
|
))
|
||||||
|
)}
|
||||||
<div className='flex items-center justify-between'>
|
<div className='flex items-center justify-between'>
|
||||||
<div className='flex items-center'>
|
<div className='flex items-center'>
|
||||||
<Image
|
<Image
|
||||||
@ -181,7 +180,7 @@ const DocumentDetails = ({ processedEvent, topics, title, summary, image, price,
|
|||||||
{renderPaymentMessage()}
|
{renderPaymentMessage()}
|
||||||
{authorView ? (
|
{authorView ? (
|
||||||
<div className='flex space-x-2 mt-4 sm:mt-0'>
|
<div className='flex space-x-2 mt-4 sm:mt-0'>
|
||||||
<GenericButton onClick={() => router.push(`/details/${nAddress}/edit`)} label="Edit" severity='warning' outlined />
|
<GenericButton onClick={() => router.push(`/details/${processedEvent.d}/edit`)} label="Edit" severity='warning' outlined />
|
||||||
<GenericButton onClick={handleDelete} label="Delete" severity='danger' outlined />
|
<GenericButton onClick={handleDelete} label="Delete" severity='danger' outlined />
|
||||||
<GenericButton
|
<GenericButton
|
||||||
tooltip={isMobileView ? null : "View Nostr Note"}
|
tooltip={isMobileView ? null : "View Nostr Note"}
|
||||||
|
@ -147,6 +147,13 @@ const VideoDetails = ({ processedEvent, topics, title, summary, image, price, au
|
|||||||
{(summary)?.split('\n').map((line, index) => (
|
{(summary)?.split('\n').map((line, index) => (
|
||||||
<p key={index}>{line}</p>
|
<p key={index}>{line}</p>
|
||||||
))}
|
))}
|
||||||
|
{processedEvent?.additionalLinks && processedEvent?.additionalLinks.length > 0 && (
|
||||||
|
processedEvent?.additionalLinks.map((link, index) => (
|
||||||
|
<a key={index} href={link} target="_blank" rel="noopener noreferrer">
|
||||||
|
{link}
|
||||||
|
</a>
|
||||||
|
))
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<ZapDisplay
|
<ZapDisplay
|
||||||
zapAmount={zapAmount}
|
zapAmount={zapAmount}
|
||||||
@ -174,7 +181,7 @@ const VideoDetails = ({ processedEvent, topics, title, summary, image, price, au
|
|||||||
</div>
|
</div>
|
||||||
{authorView ? (
|
{authorView ? (
|
||||||
<div className='flex flex-row justify-center items-center space-x-2'>
|
<div className='flex flex-row justify-center items-center space-x-2'>
|
||||||
<GenericButton size={isMobileView ? 'small' : 'large'} onClick={() => router.push(`/details/${nAddress}/edit`)} label="Edit" severity='warning' outlined />
|
<GenericButton size={isMobileView ? 'small' : 'large'} onClick={() => router.push(`/details/${processedEvent.d}/edit`)} label="Edit" severity='warning' outlined />
|
||||||
<GenericButton size={isMobileView ? 'small' : 'large'} onClick={handleDelete} label="Delete" severity='danger' outlined />
|
<GenericButton size={isMobileView ? 'small' : 'large'} onClick={handleDelete} label="Delete" severity='danger' outlined />
|
||||||
<GenericButton size={isMobileView ? 'small' : 'large'} outlined icon="pi pi-external-link" onClick={() => window.open(`https://nostr.band/${nAddress}`, '_blank')} tooltip={isMobileView ? null : "View Nostr Event"} tooltipOptions={{ position: 'right' }} />
|
<GenericButton size={isMobileView ? 'small' : 'large'} outlined icon="pi pi-external-link" onClick={() => window.open(`https://nostr.band/${nAddress}`, '_blank')} tooltip={isMobileView ? null : "View Nostr Event"} tooltipOptions={{ position: 'right' }} />
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user