Skip to content

Commit

Permalink
Merge pull request #446 from secretkeylabs/eng-4814/remaining-mixpane…
Browse files Browse the repository at this point in the history
…l-events

ENG-4814: Swaps Select From/To MixPanel Events
  • Loading branch information
jordankzf authored Aug 2, 2024
2 parents ec9dfe4 + 94e4725 commit 0fa9cd4
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 22 deletions.
38 changes: 19 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@react-spring/web": "^9.6.1",
"@sats-connect/core": "0.1.2",
"@scure/btc-signer": "1.2.1",
"@secretkeylabs/xverse-core": "18.3.0",
"@secretkeylabs/xverse-core": "18.4.0",
"@stacks/connect": "7.4.1",
"@stacks/stacks-blockchain-api-types": "6.1.1",
"@stacks/transactions": "6.13.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import TokenTile from '@components/tokenTile';
import type { FungibleToken, Token } from '@secretkeylabs/xverse-core';
import { AnalyticsEvents, type FungibleToken, type Token } from '@secretkeylabs/xverse-core';
import { StyledP } from '@ui-library/common.styled';
import Sheet from '@ui-library/sheet';
import { trackMixPanel } from '@utils/mixpanel';
import { useTranslation } from 'react-i18next';
import styled from 'styled-components';
import useFromTokens from './useFromTokens';
Expand Down Expand Up @@ -43,6 +44,9 @@ export default function TokenFromBottomSheet({ visible, title, onSelectCoin, onC
currency="BTC"
onPress={() => {
onSelectCoin(token);
trackMixPanel(AnalyticsEvents.SelectTokenToSwapFrom, {
token: 'Bitcoin',
});
onClose();
}}
/>
Expand All @@ -56,6 +60,9 @@ export default function TokenFromBottomSheet({ visible, title, onSelectCoin, onC
currency="FT"
onPress={() => {
onSelectCoin(token);
trackMixPanel(AnalyticsEvents.SelectTokenToSwapFrom, {
token: token.name,
});
onClose();
}}
fungibleToken={token}
Expand Down
15 changes: 14 additions & 1 deletion src/app/screens/swap/components/tokenToBottomSheet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@ import TokenTile from '@components/tokenTile';
import useDebounce from '@hooks/useDebounce';
import { MagnifyingGlass } from '@phosphor-icons/react';
import { mapFTProtocolToSwapProtocol, mapSwapTokenToFT } from '@screens/swap/utils';
import type { FungibleToken, Protocol, Token, TokenBasic } from '@secretkeylabs/xverse-core';
import {
AnalyticsEvents,
type FungibleToken,
type Protocol,
type Token,
type TokenBasic,
} from '@secretkeylabs/xverse-core';
import { StyledP } from '@ui-library/common.styled';
import Input from '@ui-library/input';
import Sheet from '@ui-library/sheet';
import Spinner from '@ui-library/spinner';
import { trackMixPanel } from '@utils/mixpanel';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import styled from 'styled-components';
Expand Down Expand Up @@ -152,6 +159,9 @@ export default function TokenToBottomSheet({
currency="BTC"
onPress={() => {
onSelectCoin(token);
trackMixPanel(AnalyticsEvents.SelectTokenToSwapTo, {
token: 'Bitcoin',
});
handleClose();
}}
hideBalance
Expand All @@ -166,6 +176,9 @@ export default function TokenToBottomSheet({
currency="FT"
onPress={() => {
onSelectCoin(token);
trackMixPanel(AnalyticsEvents.SelectTokenToSwapTo, {
token: token.name ?? token.ticker,
});
handleClose();
}}
fungibleToken={mapSwapTokenToFT(token)}
Expand Down

0 comments on commit 0fa9cd4

Please sign in to comment.