Skip to content

Commit d5d408d

Browse files
committed
chore: enhance umami tracking for additional user interactions in various components
1 parent b74dffc commit d5d408d

File tree

8 files changed

+30
-7
lines changed

8 files changed

+30
-7
lines changed

src/components/Account/CreatorCoin/Trade.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ const Trade = ({ coin, onClose }: TradeModalProps) => {
119119

120120
try {
121121
setLoading(true);
122+
umami.track("trade_creator_coin", { mode });
122123
await handleWrongNetwork({ chainId: base.id });
123124
const client =
124125
(await getWalletClient(config, { chainId: base.id })) || walletClient;

src/components/Account/CreatorCoin/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ const CreatorCoin = ({ account }: CreatorCoinProps) => {
4343
<>
4444
<button
4545
className="rounded-full bg-gray-200 px-2 dark:bg-gray-700"
46-
onClick={() => setShowModal(true)}
46+
onClick={() => {
47+
umami.track("open_creator_coin");
48+
setShowModal(true);
49+
}}
4750
type="button"
4851
>
4952
<MetaDetails

src/components/Account/Followerings.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,21 @@ const Followerings = ({ account }: FolloweringsProps) => {
6767
<div className="flex gap-8">
6868
<button
6969
className="flex gap-x-1"
70-
onClick={() => setShowFollowingModal(true)}
70+
onClick={() => {
71+
umami.track("open_following");
72+
setShowFollowingModal(true);
73+
}}
7174
type="button"
7275
>
7376
<b>{humanize(stats?.following)}</b>
7477
<span className="text-gray-500 dark:text-gray-200">Following</span>
7578
</button>
7679
<button
7780
className="flex gap-x-1"
78-
onClick={() => setShowFollowersModal(true)}
81+
onClick={() => {
82+
umami.track("open_followers");
83+
setShowFollowersModal(true);
84+
}}
7985
type="button"
8086
>
8187
<b>{humanize(stats?.followers)}</b>

src/components/Account/Menu/Report.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ const Report = ({ account }: ReportProps) => {
2020
"m-2 flex cursor-pointer items-center space-x-2 rounded-lg px-2 py-1.5 text-sm"
2121
)
2222
}
23-
onClick={() => setShowReportAccountModal(true, account)}
23+
onClick={() => {
24+
umami.track("open_report_account");
25+
setShowReportAccountModal(true, account);
26+
}}
2427
>
2528
<FlagIcon className="size-4" />
2629
<div>Report account</div>

src/components/Composer/Actions/Attachment.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const Attachment = () => {
6565
return toast.error("File format not allowed.");
6666
}
6767
try {
68+
umami.track("upload_attachment");
6869
await handleUploadAttachments(files);
6970
evt.target.value = "";
7071
} catch {

src/components/Composer/Actions/Gif/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ const Gif = ({ setGifAttachment }: GifProps) => {
2828
"opacity-50": disable
2929
})}
3030
disabled={disable}
31-
onClick={() => setShowModal(!showModal)}
31+
onClick={() => {
32+
umami.track("open_gif_picker");
33+
setShowModal(!showModal);
34+
}}
3235
type="button"
3336
>
3437
<GifIcon className="size-5" />

src/components/Post/Actions/Menu/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ const PostMenu = ({ post }: PostMenuProps) => {
3131
<button
3232
aria-label="More"
3333
className="rounded-full p-1.5 hover:bg-gray-300/20"
34-
onClick={stopEventPropagation}
34+
onClick={(e) => {
35+
stopEventPropagation(e);
36+
umami.track("open_post_menu");
37+
}}
3538
type="button"
3639
>
3740
<EllipsisHorizontalIcon

src/components/Post/Actions/Share/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ const ShareMenu = ({ post, showCount }: ShareMenuProps) => {
5454
: "text-gray-500 hover:bg-gray-300/20 dark:text-gray-200",
5555
"rounded-full p-1.5 outline-offset-2"
5656
)}
57-
onClick={stopEventPropagation}
57+
onClick={(e) => {
58+
stopEventPropagation(e);
59+
umami.track("open_share_menu");
60+
}}
5861
>
5962
{isSubmitting ? (
6063
<Spinner className="mr-0.5" size="xs" />

0 commit comments

Comments
 (0)