Skip to content

Commit

Permalink
posthog events
Browse files Browse the repository at this point in the history
  • Loading branch information
HrithikSampson authored and Meriem-BM committed Nov 20, 2024
1 parent 890dc27 commit e213239
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 10 additions & 1 deletion app/delegation/farcaster/AskDelegations.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import Image from 'next/image';
import { toast } from 'react-toastify';
import { usePostHog } from 'posthog-js/react';
import { WarpcastIcon } from '@/public/assets/icon-components/WarpcastIcon';

interface Props {
Expand All @@ -20,6 +21,7 @@ const AskDelegations: React.FC<Props> = ({
link,
onClose,
}) => {
const posthog = usePostHog();
const text = isBadgeHolder
? `I voted in @pairwise Liquid Democracy Experiment, ranking the ${categoryName} category of @optimism RF6.\n\nDelegate to me here:\nhttps://app.pairwise.vote/`
: `I voted in @pairwise Liquid Democracy Experiment, ranking the ${categoryName} category of @optimism RF6.`;
Expand Down Expand Up @@ -90,7 +92,14 @@ const AskDelegations: React.FC<Props> = ({
</button>
</div>

<a className="w-full" target="_blank" href={createWarpcastIntention(encodeURIComponent(text))}>
<a
className="w-full"
target="_blank"
href={createWarpcastIntention(encodeURIComponent(text))}
onClick={() => {
posthog.capture('Post of Farcaster');
}}
>
<button className="flex w-full items-center justify-center gap-2 rounded-lg border-2 border-op-neutral-300 bg-white py-2 transition-colors duration-200 hover:bg-purple-50">
<WarpcastIcon />
Post on Farcaster
Expand Down
5 changes: 1 addition & 4 deletions app/delegation/farcaster/FarcasterSuccess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ const DelegationConfirmation: React.FC<Props> = ({
target="_blank"
href={createWarpcastIntention(categoryName, username)}
onClick={() => {
posthog.capture('Post of Farcaster', {
category: categoryName,
user: username,
});
posthog.capture('Post of Farcaster');
}}
>
<button className="flex w-full items-center justify-center gap-2 rounded-lg border-2 border-op-neutral-300 bg-white py-2 transition-colors duration-200 hover:bg-purple-50">
Expand Down

0 comments on commit e213239

Please sign in to comment.