Improve comment composer and add Bible reference pills

This commit is contained in:
Adolfo Reyna
2026-02-24 16:26:58 -05:00
parent a2846423b9
commit 53df0699a7
2 changed files with 138 additions and 42 deletions

View File

@@ -4,6 +4,7 @@ import { FAB, Button, Card, Title, IconButton } from 'react-native-paper';
import API from './../API.js';
import UserName from './UserName.js';
import Media from './Media.js';
import BibleEmbeddedView from './BibleEmbeddedView.js';
import { useSnapshot } from 'valtio';
import GlobalState from '../contexts/GlobalState.js';
import Moment from 'moment';
@@ -16,7 +17,7 @@ let Comment = ({ comment, postid }) => {
const gState = useSnapshot(GlobalState);
const viewer = gState.me;
let [likes, changeLikes] = useState(Object.keys(comment.reactions).length);
let cleanContent = comment.content.replace(/@[A-z]+:.+\w/g, '');
let cleanContent = String(comment.content || '');
const newCommentReaction = () => {
if (!comment.reactions[viewer._id]) {
comment.reactions[viewer._id] = { type: "like" };
@@ -54,6 +55,7 @@ let Comment = ({ comment, postid }) => {
</View>
</View>
<Text style={{ fontSize: 14 }}>{cleanContent}</Text>
<BibleEmbeddedView content={comment.content} compact openChapterOnPress />
<Media content={comment.content} postId={postid} skiptVideo={true} />
</Card.Content>
</Card>