Skip to content

Commit af4272e

Browse files
committed
chore: enhance umami tracking for additional user interactions in sidebar, post actions, and account management components
1 parent d5d408d commit af4272e

File tree

10 files changed

+29
-7
lines changed

10 files changed

+29
-7
lines changed

src/components/Groups/Sidebar/Create/CreateGroup.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ const CreateGroup = () => {
3737
<H5>Create a group</H5>
3838
<div>Create a new group on Hey</div>
3939
</div>
40-
<Button onClick={() => setShowModal(true)}>Create group</Button>
40+
<Button
41+
onClick={() => {
42+
umami.track("open_create_group");
43+
setShowModal(true);
44+
}}
45+
>
46+
Create group
47+
</Button>
4148
</Card>
4249
<Modal
4350
onClose={() => setShowModal(false)}

src/components/Post/OpenAction/CollectAction/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ const CollectAction = ({ post }: CollectActionProps) => {
2020
<button
2121
aria-label="Collect"
2222
className="rounded-full p-1.5 outline-offset-2 hover:bg-gray-300/20"
23-
onClick={() => setShowCollectModal(true)}
23+
onClick={() => {
24+
umami.track("open_collect_modal");
25+
setShowCollectModal(true);
26+
}}
2427
type="button"
2528
>
2629
<Tooltip

src/components/Post/OpenAction/TipAction/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ const TipAction = ({ post, showCount }: TipActionProps) => {
3232
: "text-gray-500 hover:bg-gray-300/20 dark:text-gray-200",
3333
"rounded-full p-1.5 outline-offset-2"
3434
)}
35-
onClick={stopEventPropagation}
35+
onClick={(e) => {
36+
stopEventPropagation(e);
37+
umami.track("open_tip_action");
38+
}}
3639
>
3740
<Tooltip content="Tip" placement="top" withDelay>
3841
<TipIcon

src/components/Settings/Blocked/List.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ const List = () => {
7171
hideUnfollowButton
7272
/>
7373
<Button
74-
onClick={() =>
75-
setShowBlockOrUnblockAlert(true, accountBlocked.account)
76-
}
74+
onClick={() => {
75+
umami.track("open_unblock_from_list");
76+
setShowBlockOrUnblockAlert(true, accountBlocked.account);
77+
}}
7778
>
7879
Unblock
7980
</Button>

src/components/Settings/Sessions/List.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const List = () => {
4646
const handleRevoke = async (authenticationId: string) => {
4747
setRevoking(true);
4848
setRevokeingSessionId(authenticationId);
49+
umami.track("revoke_session");
4950

5051
return await revokeAuthentication({
5152
variables: { request: { authenticationId } }

src/components/Settings/Username/LinkUsername.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ const LinkUsername = () => {
6969
}
7070

7171
setLinkingUsername(localName);
72+
umami.track("link_username");
7273

7374
return await assignUsernameToAccount({
7475
variables: { request: { username: { localName } } }

src/components/Shared/Account/DismissRecommendedAccount.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const DismissRecommendedAccount = ({
1919
});
2020

2121
const handleDismiss = async () => {
22+
umami.track("dismiss_recommendation");
2223
await dismissRecommendedAccount();
2324
};
2425

src/components/Shared/Account/TipButton.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ const TipButton = ({ account }: TipButtonProps) => {
2323
<MenuButton
2424
aria-label="Tip"
2525
as={Button}
26-
onClick={stopEventPropagation}
26+
onClick={(e) => {
27+
stopEventPropagation(e);
28+
umami.track("open_tip_menu");
29+
}}
2730
outline
2831
>
2932
<Tooltip content="Tip" placement="top" withDelay>

src/components/Shared/Modal/ReportAccount/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const ReportAccount = ({ account }: ReportAccountProps) => {
4545
const reportAccount = async ({
4646
additionalComment
4747
}: z.infer<typeof ValidationSchema>) => {
48+
umami.track("report_account");
4849
const response = await createReport({
4950
variables: {
5051
request: {

src/components/Shared/Modal/ReportPost/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const ReportPost = ({ postId }: ReportPostProps) => {
3939
const reportPost = async ({
4040
additionalComment
4141
}: z.infer<typeof ValidationSchema>) => {
42+
umami.track("report_post");
4243
return await createReport({
4344
variables: {
4445
request: {

0 commit comments

Comments
 (0)