Commit 54d0bf9
authored
feat: updated currency switch clicked event for deposit and withdrawal screens (#22286)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
Updated currency switch clicked event for deposit and withdrawal screens
### Changes:
- Removed code fence blocking `EARN_INPUT_CURRENCY_SWITCH_CLICKED` event
for pooled-staking
- Added `token_symbol` and `chain_id_hex` properties to
`EARN_INPUT_CURRENCY_SWITCH_CLICKED`,
`EARN_INPUT_CURRENCY_SWITCH_CLICKED`, and
`UNSTAKE_INPUT_CURRENCY_SWITCH_CLICKED` events
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: updated earn input view deposit and withdrawal currency
switch events
## **Related issues**
Fixes: [TAT-1909: Add "Stake Input Currency Switch Clicked" to MP
Segment events](https://consensyssoftware.atlassian.net/browse/TAT-1909)
## **Manual testing steps**
```gherkin
Feature: Event tracking for Earn input view currency switch button
Scenario: user wants to enter fiat amount
Given user is on EarnInputView (e.g. ETH staking or stablecoin lending)
When user clicks currency switch
Then currency switch event is tracked with new `token_symbol` and `chain_id_hex` properties for both ETH staking and stablecoin lending tokens.
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
Pooled-Staking currency switch events weren't firing
### **After**
<!-- [screenshots/recordings] -->
https://github.com/user-attachments/assets/4b13b5bb-113e-4c9b-b18a-75375e5fcbcb
## **Pre-merge author checklist**
- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Always log currency-switch on deposit and add token_symbol and
chain_id (hex) to deposit and withdrawal currency-switch events.
>
> - **Analytics**:
> - **Deposit (`EarnInputView.tsx`)**:
> - Always log `EARN_INPUT_CURRENCY_SWITCH_CLICKED` on currency toggle
(removes prior gating).
> - Add `token_symbol` and `chain_id` (hex) to event properties.
> - **Withdrawal (`EarnWithdrawInputView.tsx`)**:
> - Add `token_symbol` and `chain_id` (hex) to
`EARN_INPUT_CURRENCY_SWITCH_CLICKED` and
`UNSTAKE_INPUT_CURRENCY_SWITCH_CLICKED`.
> - Import `toHex` for chain ID formatting.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
803d2e2. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 1f4fbdf commit 54d0bf9
File tree
2 files changed
+26
-14
lines changed- app/components/UI/Earn/Views
- EarnInputView
- EarnWithdrawInputView
2 files changed
+26
-14
lines changedLines changed: 15 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
662 | 662 | | |
663 | | - | |
664 | 663 | | |
665 | 664 | | |
666 | 665 | | |
667 | 666 | | |
668 | 667 | | |
| 668 | + | |
| 669 | + | |
669 | 670 | | |
670 | 671 | | |
671 | 672 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
576 | 577 | | |
577 | 578 | | |
578 | 579 | | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
579 | 584 | | |
580 | 585 | | |
581 | 586 | | |
| |||
591 | 596 | | |
592 | 597 | | |
593 | 598 | | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
594 | 603 | | |
595 | 604 | | |
596 | 605 | | |
| |||
603 | 612 | | |
604 | 613 | | |
605 | 614 | | |
| 615 | + | |
| 616 | + | |
606 | 617 | | |
607 | 618 | | |
608 | 619 | | |
| |||
0 commit comments