feat(reply): add floating quote preview

This commit is contained in:
Tom (plebeius.eth)
2024-06-05 22:18:45 +02:00
parent 1911b623d9
commit b44fb15078
7 changed files with 115 additions and 21 deletions
@@ -181,7 +181,7 @@ const PostMessageMobile = ({ post }: PostProps) => {
);
};
const PostMobile = ({ openReplyModal, post, roles, showAllReplies }: PostProps) => {
const PostMobile = ({ openReplyModal, post, roles, showAllReplies, showReplies = true }: PostProps) => {
const { t } = useTranslation();
const { cid, content, pinned, replyCount, subplebbitAddress } = post || {};
const { isDescription, isRules } = post || {}; // custom properties, not from api
@@ -234,6 +234,7 @@ const PostMobile = ({ openReplyModal, post, roles, showAllReplies }: PostProps)
!isDescription &&
!isRules &&
replies &&
showReplies &&
(showAllReplies ? replies : replies.slice(-5)).map((reply, index) => {
const isRouteLinkToReply = location.pathname.startsWith(`/p/${subplebbitAddress}/c/${reply?.cid}`);
return (