diff --git a/client/src/components/Header/Header.tsx b/client/src/components/Header/Header.tsx index 001204b..53539a7 100644 --- a/client/src/components/Header/Header.tsx +++ b/client/src/components/Header/Header.tsx @@ -10,10 +10,11 @@ export default function Header() { The Anon Operation + - + diff --git a/client/src/components/Modals/LinkPreview.tsx b/client/src/components/Modals/LinkPreview.tsx index 9a9d941..f53f97c 100644 --- a/client/src/components/Modals/LinkPreview.tsx +++ b/client/src/components/Modals/LinkPreview.tsx @@ -18,7 +18,7 @@ const LinkModal = ({ url }: { url: string }) => { }, [url]); if (!linkPreview) { - return {url}; // or some loading state + return {url}; // or some loading state } return ( diff --git a/client/src/components/Modals/TextModal.tsx b/client/src/components/Modals/TextModal.tsx index 3acdead..52444fe 100644 --- a/client/src/components/Modals/TextModal.tsx +++ b/client/src/components/Modals/TextModal.tsx @@ -6,59 +6,61 @@ import { nip19 } from "nostr-tools"; import LinkModal from "./LinkPreview"; const ContentPreview = ({ key, comment }: { key: string, comment: string }) => { - const [finalComment, setFinalComment] = useState(comment) - const [quoteEvents, setQuoteEvents] = useState([]); // Initialize state - const [isExpanded, setIsExpanded] = useState(false); - const [url, setUrl] = useState('') + const [finalComment, setFinalComment] = useState(comment) + const [quoteEvents, setQuoteEvents] = useState([]); // Initialize state + const [isExpanded, setIsExpanded] = useState(false); + const [url, setUrl] = useState('') - // Define your callback function for subGlobalFeed - const onEvent = (event: Event, relay: string) => { - setQuoteEvents((prevEvents) => [...prevEvents, event]); - }; + // Define your callback function for subGlobalFeed + const onEvent = (event: Event, relay: string) => { + setQuoteEvents((prevEvents) => [...prevEvents, event]); + }; - useEffect(() => { - const findUrl = comment.match(/\bhttps?:\/\/\S+/gi); - if (findUrl && findUrl.length > 0) { - setUrl(findUrl[0]) - setFinalComment(finalComment.replace(findUrl[0], '').trim()) - } - - const match = comment.match(/\bnostr:([a-z0-9]+)/i); - const nostrQuoteID = match && match[1]; - if (nostrQuoteID && nostrQuoteID.length > 0) { - let id_to_hex = String(nip19.decode(nostrQuoteID as string).data); - subNoteOnce(id_to_hex, onEvent); - setFinalComment(finalComment.replace('nostr:'+nostrQuoteID, '').trim()) - } - }, [comment, finalComment]); - - const getMetadataEvent = (event: Event) => { + useEffect(() => { + const findUrl = comment.match(/\bhttps?:\/\/\S+/gi); + if (findUrl && findUrl.length > 0) { + setUrl(findUrl[0]) + setFinalComment(finalComment.replace(findUrl[0], '').trim()) + } + + const match = comment.match(/\bnostr:([a-z0-9]+)/i); + const nostrQuoteID = match && match[1]; + if (nostrQuoteID && nostrQuoteID.length > 0) { + let id_to_hex = String(nip19.decode(nostrQuoteID as string).data); + subNoteOnce(id_to_hex, onEvent); + setFinalComment(finalComment.replace('nostr:' + nostrQuoteID, '').trim()) + } + }, [comment, finalComment]); + + const getMetadataEvent = (event: Event) => { const metadataEvent = quoteEvents.find(e => e.pubkey === event.pubkey && e.kind === 0); if (metadataEvent) { - return metadataEvent; + return metadataEvent; } return null; - } - - return ( -
- {isExpanded ? finalComment : finalComment.slice(0, 240)} - {finalComment.length > 240 && ( - - )} - {url !== '' && ( - - )} - {quoteEvents[0] && quoteEvents.length > 0 && ( - - - - )} -
- ); } - - export default ContentPreview; - \ No newline at end of file + + return ( +
+ {isExpanded ? finalComment : finalComment.slice(0, 240)} + {finalComment.length > 240 && ( + + )} + {url !== '' && ( + + )} + {quoteEvents[0] && quoteEvents.length > 0 && ( + + + + )} +
+ ); +} + +export default ContentPreview; diff --git a/client/src/components/PostCard/CardContainer.tsx b/client/src/components/PostCard/CardContainer.tsx index 9c5e68e..cc0467b 100644 --- a/client/src/components/PostCard/CardContainer.tsx +++ b/client/src/components/PostCard/CardContainer.tsx @@ -3,7 +3,7 @@ import { PropsWithChildren } from 'react'; export default function CardContainer({ children }: PropsWithChildren) { return (
-
{children}
+
{children}
); } \ No newline at end of file diff --git a/client/src/components/PostCard/NewThreadCard.tsx b/client/src/components/PostCard/NewThreadCard.tsx index b6ac183..9c5972a 100644 --- a/client/src/components/PostCard/NewThreadCard.tsx +++ b/client/src/components/PostCard/NewThreadCard.tsx @@ -145,7 +145,7 @@ const NewThreadCard: React.FC = () => { {doingWorkProp ? (
- Working... + Generating Proof-of-Work...
) : null}
diff --git a/client/src/components/PostCard/PostCard.tsx b/client/src/components/PostCard/PostCard.tsx index a6f88ae..1c5f52c 100644 --- a/client/src/components/PostCard/PostCard.tsx +++ b/client/src/components/PostCard/PostCard.tsx @@ -92,10 +92,10 @@ const PostCard = ({ key, event, metadata, replyCount }: { key: string, event: Ev
-
- {renderMedia(file)} + + {renderMedia(file)} ); diff --git a/client/src/components/Settings.tsx b/client/src/components/Settings.tsx index 4922471..305655d 100644 --- a/client/src/components/Settings.tsx +++ b/client/src/components/Settings.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'; // import {powEvent} from './system'; // import {publish} from './relays'; import { addRelay } from '../utils/relays'; - +import { CpuChipIcon } from '@heroicons/react/24/outline'; const Settings = () => { const [filterDifficulty, setFilterDifficulty] = useState(localStorage.getItem('filterDifficulty') || 21); const [difficulty, setDifficulty] = useState(localStorage.getItem('difficulty') || 21); @@ -20,9 +20,9 @@ const Settings = () => { window.dispatchEvent(event); }; -// useEffect(() => { -// addRelay('wss://powrelay.xyz'); -// }, []); + // useEffect(() => { + // addRelay('wss://powrelay.xyz'); + // }, []); return (
@@ -31,7 +31,9 @@ const Settings = () => {
{
{
-

About

-
- - - -
+

About

+
+

The Anon Operation (TAO) is an anonymous-first forum, built upon the NOSTR protocol.

+
+

TAO is built to facilitate unstoppable free speech on the internet.

+

-PWA to be widely accessible with distribution via URLS, and to side-step App Store gatekeeping

+

-Uses NOSTR as a censorship-resistant global "social" network

+

-Employs Proof-of-Work (PoW) as a spam prevention mechanism, as opposed to Captcha, moderation or other verification methods

+
+ + Github Stars Badge +
+
); diff --git a/client/src/components/Thread/ThreadPost.tsx b/client/src/components/Thread/ThreadPost.tsx index 8a6dbe1..cd028cb 100644 --- a/client/src/components/Thread/ThreadPost.tsx +++ b/client/src/components/Thread/ThreadPost.tsx @@ -173,7 +173,7 @@ const ThreadPost = ({ OPEvent, state, type }: { OPEvent: NostrEvent, state: Bool {doingWorkProp ? (
- Working... + Generating Proof-of-Work...
) : null}