mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-04-19 19:01:19 +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]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("authorView", authorView);
|
||||
}, [authorView]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("author", author);
|
||||
}, [author]);
|
||||
|
||||
const handleDelete = async () => {
|
||||
try {
|
||||
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) => (
|
||||
<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'>
|
||||
<Image
|
||||
@ -181,7 +180,7 @@ const DocumentDetails = ({ processedEvent, topics, title, summary, image, price,
|
||||
{renderPaymentMessage()}
|
||||
{authorView ? (
|
||||
<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
|
||||
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) => (
|
||||
<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>
|
||||
<ZapDisplay
|
||||
zapAmount={zapAmount}
|
||||
@ -174,7 +181,7 @@ const VideoDetails = ({ processedEvent, topics, title, summary, image, price, au
|
||||
</div>
|
||||
{authorView ? (
|
||||
<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'} outlined icon="pi pi-external-link" onClick={() => window.open(`https://nostr.band/${nAddress}`, '_blank')} tooltip={isMobileView ? null : "View Nostr Event"} tooltipOptions={{ position: 'right' }} />
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user