Improve comment composer and add Bible reference pills
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user