Initial Analitys with Posthog
This commit is contained in:
@@ -12,6 +12,7 @@ import { useSnapshot } from 'valtio';
|
||||
import GlobalState from '../contexts/GlobalState.js';
|
||||
import i18n from "../i18nMessages.js";
|
||||
import ProfilePhotoCircle from './ProfilePhotoCircle.js';
|
||||
import { posthog } from './../PostHog.js';
|
||||
|
||||
|
||||
let Post = (props) => {
|
||||
@@ -36,6 +37,12 @@ let Post = (props) => {
|
||||
changeLikes(likes + 1);
|
||||
newPostObj.reactions[viewer._id] = { type: "like" };
|
||||
API.newPostReaction(post._id);
|
||||
posthog.capture(
|
||||
'post_clicked',
|
||||
{
|
||||
post_id: post._id,
|
||||
}
|
||||
);
|
||||
} else {
|
||||
changeLikes(likes - 1);
|
||||
delete newPostObj.reactions[viewer._id];
|
||||
@@ -73,10 +80,10 @@ let Post = (props) => {
|
||||
{toProfileText}
|
||||
|
||||
</View>
|
||||
|
||||
<Text style={{ fontSize: 16, padding: 3, paddingLeft: 40 }}>{
|
||||
cleanContent
|
||||
}</Text>
|
||||
|
||||
<Text style={{ fontSize: 16, padding: 3, paddingLeft: 40 }}>{
|
||||
cleanContent
|
||||
}</Text>
|
||||
<Media content={post.content} postId={post._id} post={post} style={{ paddingTop: 2 }} />
|
||||
</View> :
|
||||
<View>
|
||||
|
||||
Reference in New Issue
Block a user