Skip to content

Commit

Permalink
send android to browser
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanmino committed Aug 17, 2020
1 parent 7f625f0 commit 6e49761
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React, { useContext, useCallback } from 'react';
import { InteractionManager } from 'react-native';
import React, { useCallback } from 'react';
import { InteractionManager, Linking } from 'react-native';
import PropTypes from 'prop-types';
import { NavigationContext } from 'react-navigation';
import { connect } from 'react-redux';
import { strings } from '../../../../../locales/i18n';
import Analytics from '../../../../core/Analytics';
import { ANALYTICS_EVENT_OPTS } from '../../../../util/analytics';

Expand All @@ -13,20 +11,18 @@ import ScreenView from '../components/ScreenView';
import Title from '../components/Title';

import TransakPaymentMethod from './transak';
import Logger from '../../../../util/Logger';

function PaymentMethodSelectorView({ selectedAddress, ...props }) {
const navigation = useContext(NavigationContext);
const transakURL = useTransakFlowURL(selectedAddress);

const onPressTransak = useCallback(() => {
navigation.navigate('TransakFlow', {
url: transakURL,
title: strings('fiat_on_ramp.transak_webview_title')
});
Linking.openURL(transakURL).catch(e => Logger.console.error('PaymentMethodSelectorView::onPressTransak', e));

InteractionManager.runAfterInteractions(() => {
Analytics.trackEvent(ANALYTICS_EVENT_OPTS.PAYMENTS_SELECTS_DEBIT_OR_ACH);
});
}, [navigation, transakURL]);
}, [transakURL]);

return (
<ScreenView>
Expand Down

0 comments on commit 6e49761

Please sign in to comment.