Skip to content

Commit

Permalink
chore: Track fee breakdown button click (#2458)
Browse files Browse the repository at this point in the history
  • Loading branch information
luads authored Dec 9, 2024
1 parent dd4d9ca commit d868b92
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,29 @@ export function Review({
[route],
);

const openFeeBreakdown = () => {
const feesToken = route?.route.estimate.feeCosts?.[0]?.token;
track({
userJourney: UserJourney.ADD_TOKENS,
screen: 'Review',
control: 'FeeBreakdown',
controlType: 'Button',
extras: {
contextId: id,
feesToken: feesToken?.symbol,
totalAmount: feesToken ? getFormattedNumber(totalFees, feesToken.decimals) : null,
totalFiatAmount: getFormattedAmounts(totalFeesUsd),
},
});

setShowFeeBreakdown(true);
};

const routeFees = useMemo(() => {
if (totalFeesUsd) {
return (
<Body
onClick={() => setShowFeeBreakdown(true)}
onClick={() => openFeeBreakdown()}
size="small"
sx={{
...hFlex,
Expand Down

0 comments on commit d868b92

Please sign in to comment.