1- import { StatusBar } from "expo-status-bar" ;
2- import { useState } from "react" ;
3- import { StyleSheet , Text , View , Button } from "react-native" ;
41import Web3Auth , { LOGIN_PROVIDER , OPENLOGIN_NETWORK , State } from "@web3auth/react-native-sdk" ;
2+ import { Buffer } from "buffer" ;
53import Constants , { AppOwnership } from "expo-constants" ;
64import * as Linking from "expo-linking" ;
5+ import { StatusBar } from "expo-status-bar" ;
76import * as WebBrowser from "expo-web-browser" ;
8- import { Buffer } from "buffer" ;
7+ import { useState } from "react" ;
8+ import { Button , StyleSheet , Text , View } from "react-native" ;
99
1010global . Buffer = global . Buffer || Buffer ;
1111
1212const scheme = "web3authexposample" ;
1313
1414const resolvedRedirectUrl =
15- Constants . appOwnership == AppOwnership . Expo || Constants . appOwnership == AppOwnership . Guest
15+ Constants . appOwnership === AppOwnership . Expo || Constants . appOwnership = == AppOwnership . Guest
1616 ? Linking . createURL ( "web3auth" , { } )
17- : Linking . createURL ( "web3auth" , { scheme : scheme } ) ;
17+ : Linking . createURL ( "web3auth" , { scheme } ) ;
18+
19+ const styles = StyleSheet . create ( {
20+ container : {
21+ flex : 1 ,
22+ backgroundColor : "#fff" ,
23+ alignItems : "center" ,
24+ justifyContent : "center" ,
25+ } ,
26+ } ) ;
1827
1928export default function App ( ) {
2029 const [ key , setKey ] = useState ( "" ) ;
@@ -27,12 +36,13 @@ export default function App() {
2736 network : OPENLOGIN_NETWORK . TESTNET ,
2837 } ) ;
2938 const state = await web3auth . login ( {
30- loginProvider : LOGIN_PROVIDER . GOOGLE ,
3139 redirectUrl : resolvedRedirectUrl ,
40+ loginProvider : LOGIN_PROVIDER . GOOGLE ,
3241 } ) ;
3342 setKey ( state . privKey || "no key" ) ;
3443 setUserInfo ( state ) ;
3544 } catch ( e ) {
45+ // eslint-disable-next-line no-console
3646 console . error ( e ) ;
3747 setErrorMsg ( String ( e ) ) ;
3848 }
@@ -48,12 +58,3 @@ export default function App() {
4858 </ View >
4959 ) ;
5060}
51-
52- const styles = StyleSheet . create ( {
53- container : {
54- flex : 1 ,
55- backgroundColor : "#fff" ,
56- alignItems : "center" ,
57- justifyContent : "center" ,
58- } ,
59- } ) ;
0 commit comments