diff --git a/client/src/components/Forms/PostFormCard.tsx b/client/src/components/Forms/PostFormCard.tsx
index cb9ca6b..ad5d749 100644
--- a/client/src/components/Forms/PostFormCard.tsx
+++ b/client/src/components/Forms/PostFormCard.tsx
@@ -50,10 +50,10 @@ const tagMapping = {
'Quote': ['q', 'p']
};
-const NewNoteCard = ({
- refEvent,
- tagType
- }: FormProps) => {
+const NewNoteCard = ({
+ refEvent,
+ tagType
+}: FormProps) => {
const [comment, setComment] = useState("");
const [file, setFile] = useState("");
const [sk, setSk] = useState(generatePrivateKey());
@@ -67,7 +67,8 @@ const NewNoteCard = ({
const [difficulty, setDifficulty] = useState(
localStorage.getItem("difficulty") || "21"
);
-
+ const [fileSizeError, setFileSizeError] = useState(false);
+
const [uploadingFile, setUploadingFile] = useState(false);
const [doingWorkProp, setDoingWorkProp] = useState(false);
@@ -83,7 +84,7 @@ const NewNoteCard = ({
if (tags) {
tags.forEach(tag => unsigned.tags.push([tag, refEvent[tag === 'p' ? 'pubkey' : 'id']]));
}
-
+
if (tagType === 'Quote') {
setComment(comment + ' nostr:' + nip19.noteEncode(refEvent.id));
}
@@ -145,12 +146,12 @@ const NewNoteCard = ({
setDoingWorkProp(true);
}}
>
-
+
- Start a New Thread
+ {tagType === 'Reply' ? 'Reply to thread' : 'Start Thread'}
+ {fileSizeError ? (
+ File size should not exceed 2.5MB
+ ) : null}
{doingWorkProp ? (
diff --git a/client/src/components/Modals/Card.tsx b/client/src/components/Modals/Card.tsx
index ee82e25..1f69508 100644
--- a/client/src/components/Modals/Card.tsx
+++ b/client/src/components/Modals/Card.tsx
@@ -60,8 +60,24 @@ const PostCard = ({
return (
-
-
+
+
+
+
+ {renderMedia(file)}
+ {repliedTo &&
+
Reply to:
+ {uniqBy(repliedTo, 'pubkey').map((event, index) => (
+
+ {event.kind === 0 ? (
+
+ ) : (
+
+ )}
+
+ ))}
+
}
+
{metadataParsed ?
- {repliedTo &&
-
Reply to:
- {uniqBy(repliedTo, 'pubkey').map((event, index) => (
-
- {event.kind === 0 ? (
-
- ) : (
-
- )}
-
- ))}
-
}
-
-
-
- {renderMedia(file)}
);
};
diff --git a/client/src/components/Modals/CardContainer.tsx b/client/src/components/Modals/CardContainer.tsx
index 8e28b75..1d83099 100644
--- a/client/src/components/Modals/CardContainer.tsx
+++ b/client/src/components/Modals/CardContainer.tsx
@@ -3,7 +3,7 @@ import { PropsWithChildren } from "react";
export default function CardContainer({ children }: PropsWithChildren) {
return (
-
{children}
+
{children}
);
}
diff --git a/client/src/components/Modals/CardModals/QuoteEmbed.tsx b/client/src/components/Modals/CardModals/QuoteEmbed.tsx
index d7d4938..13ec7ef 100644
--- a/client/src/components/Modals/CardModals/QuoteEmbed.tsx
+++ b/client/src/components/Modals/CardModals/QuoteEmbed.tsx
@@ -70,6 +70,10 @@ const QuoteEmbed = ({
return (
+
+
+
+ {renderMedia(file)}
{metadataParsed ? (
@@ -84,17 +88,13 @@ const QuoteEmbed = ({
) : (
<>
Anonymous
>
)}
-
-
-
- {renderMedia(file)}
);
diff --git a/client/src/components/Modals/CardModals/TextModal.tsx b/client/src/components/Modals/CardModals/TextModal.tsx
index 753762c..151dc4c 100644
--- a/client/src/components/Modals/CardModals/TextModal.tsx
+++ b/client/src/components/Modals/CardModals/TextModal.tsx
@@ -1,3 +1,4 @@
+import React from "react";
import QuoteEmbed from "./QuoteEmbed";
import { Event } from "nostr-tools";
import { useEffect, useState } from "react";
@@ -44,7 +45,10 @@ const ContentPreview = ({ key, comment }: { key: string; comment: string }) => {
return (
- {isExpanded ? finalComment : finalComment.slice(0, 350)}
+ {isExpanded
+ ? finalComment.split('\n').map((line, i) => {line}
)
+ : finalComment.slice(0, 350).split('\n').map((line, i) => {line}
)
+ }
{finalComment.length > 350 && (