diff --git a/src/components/content/courses/CourseDetails.js b/src/components/content/courses/CourseDetails.js index cd064a2..6e622bc 100644 --- a/src/components/content/courses/CourseDetails.js +++ b/src/components/content/courses/CourseDetails.js @@ -113,6 +113,35 @@ export default function CourseDetails({ processedEvent, paidCourse, lessons, dec return null; }; + const renderAdditionalLinks = () => { + if (processedEvent?.additionalLinks && processedEvent.additionalLinks.length > 0) { + return ( +
+

Additional Links:

+ {processedEvent.additionalLinks.map((link, index) => ( +
+ + {link} + +
+ ))} +
+ ); + } + return null; + }; + if (!processedEvent || !author) { return
; } @@ -183,9 +212,10 @@ export default function CourseDetails({ processedEvent, paidCourse, lessons, dec window.open(`https://nostr.band/${nAddress}`, '_blank')} tooltip={isMobileView ? null : "View Nostr Event"} tooltipOptions={{ position: paidCourse ? 'left' : 'right' }} /> )} + {renderAdditionalLinks()} ); -} \ No newline at end of file +} diff --git a/src/components/content/documents/DocumentDetails.js b/src/components/content/documents/DocumentDetails.js index afe454e..210b656 100644 --- a/src/components/content/documents/DocumentDetails.js +++ b/src/components/content/documents/DocumentDetails.js @@ -151,12 +151,22 @@ const DocumentDetails = ({ processedEvent, topics, title, summary, image, price,

Additional Links:

{processedEvent.additionalLinks.map((link, index) => ( - - +
+ {link} -
- +
))}
)} diff --git a/src/components/content/videos/VideoDetails.js b/src/components/content/videos/VideoDetails.js index ef56bb9..af4817a 100644 --- a/src/components/content/videos/VideoDetails.js +++ b/src/components/content/videos/VideoDetails.js @@ -126,6 +126,35 @@ const VideoDetails = ({ processedEvent, topics, title, summary, image, price, au return null; } + const renderAdditionalLinks = () => { + if (processedEvent?.additionalLinks && processedEvent.additionalLinks.length > 0) { + return ( +
+

Additional Links:

+ {processedEvent.additionalLinks.map((link, index) => ( +
+ + {link} + +
+ ))} +
+ ); + } + return null; + }; + return (
{renderContent()} @@ -154,19 +183,7 @@ const VideoDetails = ({ processedEvent, topics, title, summary, image, price, au {(summary)?.split('\n').map((line, index) => (

{line}

))} - {processedEvent?.additionalLinks && processedEvent?.additionalLinks.length > 0 && ( -
-

Additional Links:

- {processedEvent.additionalLinks.map((link, index) => ( - - - {link} - -
-
- ))} -
- )} + {renderAdditionalLinks()}
diff --git a/src/components/feeds/DiscordFeed.js b/src/components/feeds/DiscordFeed.js index 21c6acd..dfe28b7 100644 --- a/src/components/feeds/DiscordFeed.js +++ b/src/components/feeds/DiscordFeed.js @@ -33,7 +33,7 @@ const DiscordFeed = ({ searchQuery }) => { } return ( -
+
{filteredData.length > 0 ? ( filteredData.map(message => ( diff --git a/src/components/feeds/GlobalFeed.js b/src/components/feeds/GlobalFeed.js index 87c4c4e..563b30e 100644 --- a/src/components/feeds/GlobalFeed.js +++ b/src/components/feeds/GlobalFeed.js @@ -108,7 +108,7 @@ const GlobalFeed = ({searchQuery}) => { }); return ( -
+
{combinedFeed.length > 0 ? ( combinedFeed.map(item => ( diff --git a/src/components/feeds/NostrFeed.js b/src/components/feeds/NostrFeed.js index e8edfe3..fca1298 100644 --- a/src/components/feeds/NostrFeed.js +++ b/src/components/feeds/NostrFeed.js @@ -5,45 +5,36 @@ import { useSession } from 'next-auth/react'; import { findKind0Fields } from '@/utils/nostr'; import NostrIcon from '../../../public/images/nostr.png'; import Image from 'next/image'; -import { useImageProxy } from '@/hooks/useImageProxy'; import useWindowWidth from '@/hooks/useWindowWidth'; import { nip19 } from 'nostr-tools'; import { useCommunityNotes } from '@/hooks/nostr/useCommunityNotes'; import CommunityMessage from '@/components/feeds/messages/CommunityMessage'; -import ZapThreadsWrapper from '@/components/ZapThreadsWrapper'; const NostrFeed = ({ searchQuery }) => { const { communityNotes, isLoading, error } = useCommunityNotes(); const { ndk } = useNDKContext(); - const { returnImageProxy } = useImageProxy(); const { data: session } = useSession(); const [authorData, setAuthorData] = useState({}); - const [npub, setNpub] = useState(null); const windowWidth = useWindowWidth(); useEffect(() => { const fetchAuthors = async () => { - const authorDataMap = {}; for (const message of communityNotes) { - if (!authorDataMap[message.pubkey]) { + if (!authorData[message.pubkey]) { const author = await fetchAuthor(message.pubkey); - authorDataMap[message.pubkey] = author; + setAuthorData(prevData => ({ + ...prevData, + [message.pubkey]: author + })); } } - setAuthorData(authorDataMap); }; if (communityNotes && communityNotes.length > 0) { fetchAuthors(); } - }, [communityNotes]); - - useEffect(() => { - if (session?.user?.pubkey) { - setNpub(nip19.npubEncode(session.user.pubkey)); - } - }, [session]); + }, [communityNotes, authorData]); const fetchAuthor = async (pubkey) => { try { @@ -86,7 +77,7 @@ const NostrFeed = ({ searchQuery }) => { .sort((a, b) => b.created_at - a.created_at); return ( -
+
{filteredNotes.length > 0 ? ( filteredNotes.map(message => ( @@ -95,7 +86,7 @@ const NostrFeed = ({ searchQuery }) => { message={{ id: message.id, author: authorData[message.pubkey]?.username || message.pubkey.substring(0, 12) + '...', - avatar: authorData[message.pubkey]?.avatar ? returnImageProxy(authorData[message.pubkey]?.avatar) : null, + avatar: authorData[message.pubkey]?.avatar, content: message.content, timestamp: message.created_at * 1000, channel: "plebdevs" @@ -115,4 +106,4 @@ const NostrFeed = ({ searchQuery }) => { ); }; -export default NostrFeed; \ No newline at end of file +export default NostrFeed; diff --git a/src/components/feeds/StackerNewsFeed.js b/src/components/feeds/StackerNewsFeed.js index 7cbfe46..53b5e9c 100644 --- a/src/components/feeds/StackerNewsFeed.js +++ b/src/components/feeds/StackerNewsFeed.js @@ -45,7 +45,7 @@ const StackerNewsFeed = ({ searchQuery }) => { .sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt)); return ( -
+
{filteredItems && filteredItems.length > 0 ? ( filteredItems.map(item => ( diff --git a/src/components/profile/subscription/SubscribeModal.js b/src/components/profile/subscription/SubscribeModal.js index 37d8ace..a3ec1d0 100644 --- a/src/components/profile/subscription/SubscribeModal.js +++ b/src/components/profile/subscription/SubscribeModal.js @@ -149,13 +149,20 @@ const SubscribeModal = ({ user }) => { return ( <> - {subscribed && ( + {subscribed && !user?.role?.nwc && (

Thank you for your support 🎉

Pay-as-you-go subscription will renew on {subscribedUntil.toLocaleDateString()}

)} + {subscribed && user?.role?.nwc && ( +
+ +

Thank you for your support 🎉

+

Recurring subscription will AUTO renew on {subscribedUntil.toLocaleDateString()}

+
+ )} {(!subscribed && !subscriptionExpiredAt) && (
diff --git a/src/components/profile/subscription/UserSubscription.js b/src/components/profile/subscription/UserSubscription.js index 1d43ddd..ab16668 100644 --- a/src/components/profile/subscription/UserSubscription.js +++ b/src/components/profile/subscription/UserSubscription.js @@ -101,11 +101,18 @@ const UserSubscription = () => {

Subscription Management

)}
- {subscribed && ( + {subscribed && !user?.role?.nwc && (

Thank you for your support 🎉

-

Pay-as-you-go subscription will renew on {subscribedUntil.toLocaleDateString()}

+

Pay-as-you-go subscription requires manual renewal on {subscribedUntil.toLocaleDateString()}

+
+ )} + {subscribed && user?.role?.nwc && ( +
+ +

Thank you for your support 🎉

+

Recurring subscription will AUTO renew on {subscribedUntil.toLocaleDateString()}

)} {(!subscribed && !subscriptionExpiredAt) && ( diff --git a/src/config/appConfig.js b/src/config/appConfig.js index b544ca3..d7cdd67 100644 --- a/src/config/appConfig.js +++ b/src/config/appConfig.js @@ -11,7 +11,7 @@ const appConfig = { // "wss://purplerelay.com/", "wss://relay.devs.tools/" ], - authorPubkeys: ["8cb60e215678879cda0bef4d5b3fc1a5c5925d2adb5d8c4fa7b7d03b5f2deaea", "676c02247668d5b18479be3d1a80933044256f3fbd03640a8c234684e641b6d6", "f33c8a9617cb15f705fc70cd461cfd6eaf22f9e24c33eabad981648e5ec6f741", "c67cd3e1a83daa56cff16f635db2fdb9ed9619300298d4701a58e68e84098345"], + authorPubkeys: ["468f729dd409053dac5e7470622c3996aad88db6ed1de9165cb1921b5ab4fd5e","8cb60e215678879cda0bef4d5b3fc1a5c5925d2adb5d8c4fa7b7d03b5f2deaea", "676c02247668d5b18479be3d1a80933044256f3fbd03640a8c234684e641b6d6", "f33c8a9617cb15f705fc70cd461cfd6eaf22f9e24c33eabad981648e5ec6f741", "c67cd3e1a83daa56cff16f635db2fdb9ed9619300298d4701a58e68e84098345"], customLightningAddresses: [ { // todo remove need for lowercase diff --git a/src/pages/about.js b/src/pages/about.js index 995bf62..793e9e1 100644 --- a/src/pages/about.js +++ b/src/pages/about.js @@ -13,6 +13,7 @@ const AboutPage = () => { const windowWidth = useWindowWidth(); const isTabView = windowWidth <= 1360; + const isMobile = windowWidth < 768; const copyToClipboard = async (text) => { try { @@ -31,9 +32,9 @@ const AboutPage = () => { }; return ( -
+
- +
diff --git a/src/pages/feed.js b/src/pages/feed.js index 0be8b0a..d810004 100644 --- a/src/pages/feed.js +++ b/src/pages/feed.js @@ -51,7 +51,7 @@ const Feed = () => { }; return ( -
+

Feeds

diff --git a/src/pages/subscribe.js b/src/pages/subscribe.js index 1b69ec1..b0ee753 100644 --- a/src/pages/subscribe.js +++ b/src/pages/subscribe.js @@ -147,13 +147,20 @@ const Subscribe = () => {
{session && session?.user ? ( <> - {subscribed && ( + {subscribed && !user?.role?.nwc && (

Thank you for your support 🎉

Pay-as-you-go subscription must be manually renewed on {subscribedUntil.toLocaleDateString()}

)} + {subscribed && user?.role?.nwc && ( +
+ +

Thank you for your support 🎉

+

Recurring subscription will AUTO renew on {subscribedUntil.toLocaleDateString()}

+
+ )} {(!subscribed && !subscriptionExpiredAt) && (