Skip to content

Commit

Permalink
add events for manually added bills
Browse files Browse the repository at this point in the history
  • Loading branch information
msalcala11 committed Dec 15, 2023
1 parent 30ebe2f commit 1885ae6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
10 changes: 9 additions & 1 deletion src/navigation/tabs/shop/bill/components/BillList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import moment from 'moment';
import {TouchableOpacity} from 'react-native';
import {useTranslation} from 'react-i18next';
import {ActiveOpacity} from '../../../../../components/styled/Containers';
import BillItem from './BillItem';
import {
Expand All @@ -10,8 +11,9 @@ import {
} from '../../../../../store/shop/shop.models';
import {APP_NETWORK} from '../../../../../constants/config';
import {AppActions} from '../../../../../store/app';
import {Analytics} from '../../../../../store/analytics/analytics.effects';
import {useAppDispatch, useAppSelector} from '../../../../../utils/hooks';
import {useTranslation} from 'react-i18next';
import {getBillAccountEventParams} from '../utils';

const sortByAscendingDate = (a: BillPayAccount, b: BillPayAccount) => {
const farIntoTheFuture = moment().add(1, 'year').toDate();
Expand Down Expand Up @@ -119,6 +121,12 @@ export const BillList = ({
],
}),
);
dispatch(
Analytics.track(
'Bill Pay — Viewed Why Is My Bill Connecting',
getBillAccountEventParams(account),
),
);
}
return;
}
Expand Down
13 changes: 8 additions & 5 deletions src/navigation/tabs/shop/bill/screens/ConnectBillsOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ const ConnectBillsOptions = ({
dispatch(Analytics.track('Bill Pay — Clicked Connect My Bills'));
};

const searchBills = () => {
navigation.navigate(BillScreens.CONNECT_BILLS, {
tokenType: 'link',
});
dispatch(Analytics.track('Bill Pay — Clicked Search Bills'));
};

return (
<>
<ScrollView
Expand Down Expand Up @@ -246,11 +253,7 @@ const ConnectBillsOptions = ({
<Button
state={continueButtonState}
onPress={() => {
selectedOption === 'auto'
? verifyUserInfo()
: navigation.navigate(BillScreens.CONNECT_BILLS, {
tokenType: 'link',
});
selectedOption === 'auto' ? verifyUserInfo() : searchBills();
}}
buttonStyle={'primary'}>
{continueButtonState === 'loading' ? t('Loading...') : t('Continue')}
Expand Down

0 comments on commit 1885ae6

Please sign in to comment.