Valtio and new tab menu
This commit is contained in:
@@ -8,9 +8,12 @@ import Media from './Media.js';
|
||||
import Comment from "./Comment";
|
||||
import NewComment from './NewComment.js';
|
||||
import Moment from 'moment';
|
||||
import { useSnapshot } from 'valtio';
|
||||
import GlobalState from '../contexts/GlobalState.js';
|
||||
|
||||
let Post = (props) => {
|
||||
const viewer = props.viewer;
|
||||
const gState = useSnapshot(GlobalState);
|
||||
const viewer = gState.me;
|
||||
let [showCommentsB, changeshowCommentsB] = useState(false);
|
||||
let [post, changePost] = useState(props.post);
|
||||
let [likes, changeLikes] = useState(Object.keys(post.reactions).length);
|
||||
@@ -50,7 +53,7 @@ let Post = (props) => {
|
||||
}
|
||||
}
|
||||
const renderComment = ({ item }) => (
|
||||
<Comment comment={item} viewer={viewer} postid={post._id} />
|
||||
<Comment comment={item} postid={post._id} />
|
||||
);
|
||||
return (
|
||||
<Card style={styles.card}>
|
||||
|
||||
Reference in New Issue
Block a user