-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #674 from plaid/dt-fabric-example
- Loading branch information
Showing
8 changed files
with
135 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
module.exports = { | ||
root: true, | ||
extends: '@react-native', | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
], | ||
ignorePatterns: [ | ||
'babel.config.js', | ||
'.eslintrc.js', | ||
'jest.config.js', | ||
'metro.config.js', | ||
], | ||
}; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,61 @@ | ||
import * as React from 'react'; | ||
import { TextInput, Text, View } from 'react-native'; | ||
import { styles } from '../Styles'; | ||
import { EmbeddedLinkView, LinkIOSPresentationStyle, LinkEvent, LinkExit, LinkSuccess } from 'react-native-plaid-link-sdk'; | ||
import {TextInput, Text, View} from 'react-native'; | ||
import {styles} from '../Styles'; | ||
import { | ||
EmbeddedLinkView, | ||
LinkIOSPresentationStyle, | ||
LinkEvent, | ||
LinkExit, | ||
LinkSuccess, | ||
} from 'react-native-plaid-link-sdk'; | ||
|
||
// Simple conditional view to display Embedded Link once a token has been entered. | ||
var EmbeddedView = ({token}: {token: string}) => { | ||
let content | ||
const EmbeddedView = ({token}: {token: string}) => { | ||
let content; | ||
|
||
if (token) { | ||
content = <View> | ||
<EmbeddedLinkView | ||
token={token} | ||
iOSPresentationStyle={LinkIOSPresentationStyle.FULL_SCREEN} | ||
onEvent={(event: LinkEvent) => { | ||
console.log('onEvent', event); | ||
}} | ||
onSuccess={(success: LinkSuccess) => { | ||
console.log('onSuccess', success); | ||
}} | ||
onExit={(exit: LinkExit) => { | ||
console.log('onExit', exit); | ||
}} | ||
style={styles.embedded} | ||
/> | ||
</View> | ||
} else { | ||
content = <Text style={{ fontSize: 24, color: '#2196F3', textAlign: 'center' }}>Enter Link Token</Text> | ||
} | ||
|
||
return <View style={{ padding: 24 }}>{content}</View> | ||
} | ||
if (token) { | ||
content = ( | ||
<View> | ||
<EmbeddedLinkView | ||
token={token} | ||
iOSPresentationStyle={LinkIOSPresentationStyle.MODAL} | ||
onEvent={(event: LinkEvent) => { | ||
console.log('onEvent', event); | ||
}} | ||
onSuccess={(success: LinkSuccess) => { | ||
console.log('onSuccess', success); | ||
}} | ||
onExit={(exit: LinkExit) => { | ||
console.log('onExit', exit); | ||
}} | ||
style={styles.embedded} | ||
/> | ||
</View> | ||
); | ||
} else { | ||
content = ( | ||
<Text style={{fontSize: 24, color: '#2196F3', textAlign: 'center'}}> | ||
Enter Link Token | ||
</Text> | ||
); | ||
} | ||
|
||
export function PlaidEmbeddedLinkScreen() { | ||
return <View style={{padding: 24}}>{content}</View>; | ||
}; | ||
|
||
const [text, setText] = React.useState(''); | ||
export function PlaidEmbeddedLinkScreen(): React.JSX.Element { | ||
const [text, setText] = React.useState(''); | ||
|
||
return ( | ||
<> | ||
<TextInput | ||
style={styles.input} | ||
onChangeText={newText => setText(newText)} | ||
value={text} | ||
placeholder="link-sandbox-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||
placeholderTextColor={'#D3D3D3'} | ||
/> | ||
<EmbeddedView token={text} /> | ||
</> | ||
); | ||
return ( | ||
<> | ||
<TextInput | ||
style={styles.input} | ||
onChangeText={newText => setText(newText)} | ||
value={text} | ||
placeholder="link-sandbox-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||
placeholderTextColor={'#D3D3D3'} | ||
/> | ||
<EmbeddedView token={text} /> | ||
</> | ||
); | ||
} |
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