@@ -2,20 +2,31 @@ import { StatusBar } from "expo-status-bar";
22import { useEffect , useRef , useState } from "react" ;
33import { StyleSheet , Text , View , Button } from "react-native" ;
44import Web3Auth , { LOGIN_PROVIDER , OPENLOGIN_NETWORK , State } from "@web3auth/react-native-sdk" ;
5+ import { Buffer } from "buffer" ;
56import Constants , { AppOwnership } from "expo-constants" ;
67import * as Linking from "expo-linking" ;
78import * as WebBrowser from "expo-web-browser" ;
89import * as SecureStore from 'expo-secure-store' ;
9- import { Buffer } from "buffer" ;
10+ import { useState } from "react" ;
11+ import { Button , StyleSheet , Text , View } from "react-native" ;
1012
1113global . Buffer = global . Buffer || Buffer ;
1214
1315const scheme = "web3authexposample" ;
1416
1517const resolvedRedirectUrl =
16- Constants . appOwnership == AppOwnership . Expo || Constants . appOwnership == AppOwnership . Guest
18+ Constants . appOwnership === AppOwnership . Expo || Constants . appOwnership = == AppOwnership . Guest
1719 ? Linking . createURL ( "web3auth" , { } )
18- : Linking . createURL ( "web3auth" , { scheme : scheme } ) ;
20+ : Linking . createURL ( "web3auth" , { scheme } ) ;
21+
22+ const styles = StyleSheet . create ( {
23+ container : {
24+ flex : 1 ,
25+ backgroundColor : "#fff" ,
26+ alignItems : "center" ,
27+ justifyContent : "center" ,
28+ } ,
29+ } ) ;
1930
2031export default function App ( ) {
2132 const [ key , setKey ] = useState ( "" ) ;
@@ -39,11 +50,11 @@ export default function App() {
3950 try {
4051 const state = await web3auth . current . login ( {
4152 loginProvider : LOGIN_PROVIDER . GOOGLE ,
42- redirectUrl : resolvedRedirectUrl ,
4353 } ) ;
4454 setKey ( state . privKey || "no key" ) ;
4555 setUserInfo ( state ) ;
4656 } catch ( e ) {
57+ // eslint-disable-next-line no-console
4758 console . error ( e ) ;
4859 setErrorMsg ( String ( e ) ) ;
4960 }
@@ -59,12 +70,3 @@ export default function App() {
5970 </ View >
6071 ) ;
6172}
62-
63- const styles = StyleSheet . create ( {
64- container : {
65- flex : 1 ,
66- backgroundColor : "#fff" ,
67- alignItems : "center" ,
68- justifyContent : "center" ,
69- } ,
70- } ) ;
0 commit comments