From ad394a6f18f078717d7a1046caa80b165cbdcdd2 Mon Sep 17 00:00:00 2001 From: Adolfo Reyna Date: Sat, 22 Feb 2025 00:00:29 -0500 Subject: [PATCH] Open comments on singlepost view --- Views/NotificationsView.js | 2 +- components/Post.js | 15 +++++++++++---- components/SinglePostComponent.js | 13 ++++++++----- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Views/NotificationsView.js b/Views/NotificationsView.js index 34a8bf1..4086584 100644 --- a/Views/NotificationsView.js +++ b/Views/NotificationsView.js @@ -21,7 +21,7 @@ let NotificationsView = ({ navigation, route }) => { {" " + Moment(item.ts).fromNow()} - + ) diff --git a/components/Post.js b/components/Post.js index eb1b6cd..1d90199 100644 --- a/components/Post.js +++ b/components/Post.js @@ -13,18 +13,20 @@ import GlobalState from '../contexts/GlobalState.js'; import i18n from "../i18nMessages.js"; import ProfilePhotoCircle from './ProfilePhotoCircle.js'; import { posthog } from './../PostHog.js'; +import { useNavigation } from '@react-navigation/native'; let Post = (props) => { const gState = useSnapshot(GlobalState); const viewer = gState.me; - let [showCommentsB, changeshowCommentsB] = useState(false); + let [showCommentsB, changeshowCommentsB] = useState(props.showComments || false); let [post, changePost] = useState(props.post); let [likes, changeLikes] = useState(Object.keys(post.reactions).length); let [bookmarked, changeBookmarked] = useState(post.bookmarks && post.bookmarks.includes(viewer._id)); let toProfileText = post.toProfile && post.toProfile !== post.profileid ? : undefined; let cleanContent = post.content.replace(/@[A-z]+:.+\w/g, '').trim(); + const navigation = useNavigation(); //cleanContent = convertLinks(cleanContent); const newComentAdded = (commentData) => { let newPostObj = { ...post }; @@ -105,7 +107,13 @@ let Post = (props) => { {likes}