forked from plaid/react-plaid-link
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hoc.js
32 lines (28 loc) · 900 Bytes
/
hoc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import React from 'react';
import { PlaidLink } from '../src';
const App = props => {
const onExit = (error, metadata) => console.log('onExit', error, metadata);
const onEvent = (eventName, metadata) =>
console.log('onEvent', eventName, metadata);
const onSuccess = (token, metadata) =>
console.log('onSuccess', token, metadata);
return (
<>
<PlaidLink
className="CustomButton"
style={{ padding: '20px', fontSize: '16px', cursor: 'pointer' }}
clientName={props.clientName || 'Your app name'}
env={props.env || 'sandbox'}
product={props.product || ['auth', 'transactions']}
publicKey={props.publicKey || '...'}
token={props.token}
onExit={onExit}
onSuccess={onSuccess}
onEvent={onEvent}
>
Open Link and connect your bank!
</PlaidLink>
</>
);
};
export default App;