forked from deriv-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WALL] george / WALL-4522 / Add ce_cashier_deposit_onboarding_form an…
…alytics events (deriv-com#16260) * feat(cashier): 🎨 add ce_cashier_deposit_onboarding_form analytics event * chore: 🔖 update analytics
- Loading branch information
1 parent
3a4c990
commit ccc9735
Showing
25 changed files
with
273 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...nts/deposit-sub-page-analytics-event-tracker/deposit-sub-page-analytics-event-tracker.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React, { useEffect } from 'react'; | ||
import { Analytics } from '@deriv-com/analytics'; | ||
import { useStore } from '@deriv/stores'; | ||
|
||
type TProps = { deposit_category: 'crypto' | 'fiat' | 'fiat_onramp' | 'payment_agent' | 'p2p' }; | ||
|
||
const DepositSubPageAnalyticsEventTracker: React.FC<TProps> = ({ deposit_category }) => { | ||
const { client } = useStore(); | ||
const { currency, loginid } = client; | ||
|
||
useEffect(() => { | ||
Analytics.trackEvent('ce_cashier_deposit_onboarding_form', { | ||
action: 'open_deposit_subpage', | ||
form_name: 'ce_cashier_deposit_onboarding_form', | ||
currency, | ||
deposit_category, | ||
login_id: loginid, | ||
}); | ||
}, [currency, deposit_category, loginid]); | ||
|
||
return null; | ||
}; | ||
|
||
export default DepositSubPageAnalyticsEventTracker; |
1 change: 1 addition & 0 deletions
1
packages/cashier/src/components/deposit-sub-page-analytics-event-tracker/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as DepositSubPageAnalyticsEventTracker } from './deposit-sub-page-analytics-event-tracker'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,38 @@ import { APIProvider } from '@deriv/api'; | |
jest.mock('@deriv/hooks', () => { | ||
return { | ||
...jest.requireActual('@deriv/hooks'), | ||
usePaymentAgentList: jest.fn(() => ({ | ||
data: [ | ||
{ | ||
currencies: 'USD', | ||
email: '[email protected]', | ||
further_information: 'Further information', | ||
max_withdrawal: '2000', | ||
min_withdrawal: '10', | ||
name: 'PA', | ||
paymentagent_loginid: 'CR9999999', | ||
phone_numbers: [ | ||
{ | ||
phone_number: '+987654321', | ||
}, | ||
], | ||
summary: '', | ||
supported_payment_methods: [ | ||
{ | ||
payment_method: 'Visa', | ||
}, | ||
], | ||
urls: [ | ||
{ | ||
url: 'https://test.test', | ||
}, | ||
], | ||
withdrawal_commission: '0', | ||
}, | ||
], | ||
isLoading: false, | ||
isSuccess: true, | ||
})), | ||
usePaymentAgentTransferVisible: jest.fn(() => ({ | ||
data: true, | ||
isLoading: false, | ||
|
@@ -106,9 +138,6 @@ describe('<Cashier />', () => { | |
transaction_history: { | ||
is_transactions_crypto_visible: false, | ||
}, | ||
payment_agent: { | ||
is_payment_agent_visible: false, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
@@ -156,9 +185,6 @@ describe('<Cashier />', () => { | |
transaction_history: { | ||
is_transactions_crypto_visible: true, | ||
}, | ||
payment_agent: { | ||
is_payment_agent_visible: true, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
@@ -209,9 +235,6 @@ describe('<Cashier />', () => { | |
// transaction_history: { | ||
// is_transactions_crypto_visible: false, | ||
// }, | ||
// payment_agent: { | ||
// is_payment_agent_visible: true, | ||
// }, | ||
// }, | ||
// }, | ||
// }); | ||
|
@@ -262,9 +285,6 @@ describe('<Cashier />', () => { | |
transaction_history: { | ||
is_transactions_crypto_visible: true, | ||
}, | ||
payment_agent: { | ||
is_payment_agent_visible: true, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
@@ -314,9 +334,6 @@ describe('<Cashier />', () => { | |
transaction_history: { | ||
is_transactions_crypto_visible: true, | ||
}, | ||
payment_agent: { | ||
is_payment_agent_visible: true, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
@@ -367,9 +384,6 @@ describe('<Cashier />', () => { | |
transaction_history: { | ||
is_transactions_crypto_visible: true, | ||
}, | ||
payment_agent: { | ||
is_payment_agent_visible: true, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.