diff --git a/android/app/build.gradle b/android/app/build.gradle index cd5361c34..3ea3e76b7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -135,6 +135,7 @@ android { } dependencies { + compile project(':react-native-cookies') compile project(':react-native-i18n') compile project(':react-native-photo-view') compile project(':react-native-config') diff --git a/android/app/src/main/java/com/gitpoint/MainApplication.java b/android/app/src/main/java/com/gitpoint/MainApplication.java index 0ecd03098..3a891d54e 100644 --- a/android/app/src/main/java/com/gitpoint/MainApplication.java +++ b/android/app/src/main/java/com/gitpoint/MainApplication.java @@ -3,6 +3,7 @@ import android.app.Application; import com.facebook.react.ReactApplication; +import com.psykar.cookiemanager.CookieManagerPackage; import com.AlexanderZaytsev.RNI18n.RNI18nPackage; import com.reactnative.photoview.PhotoViewPackage; import com.lugg.ReactNativeConfig.ReactNativeConfigPackage; @@ -35,6 +36,7 @@ public boolean getUseDeveloperSupport() { protected List getPackages() { return Arrays.asList( new MainReactPackage(), + new CookieManagerPackage(), new RNI18nPackage(), new PhotoViewPackage(), new ReactNativeConfigPackage(), diff --git a/android/settings.gradle b/android/settings.gradle index 50b6542b4..4572a0974 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,4 +1,6 @@ rootProject.name = 'GitPoint' +include ':react-native-cookies' +project(':react-native-cookies').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-cookies/android') include ':react-native-i18n' project(':react-native-i18n').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-i18n/android') include ':react-native-photo-view' diff --git a/ios/GitPoint.xcodeproj/project.pbxproj b/ios/GitPoint.xcodeproj/project.pbxproj index 055de382b..1901909c6 100644 --- a/ios/GitPoint.xcodeproj/project.pbxproj +++ b/ios/GitPoint.xcodeproj/project.pbxproj @@ -5,6 +5,7 @@ }; objectVersion = 46; objects = { + /* Begin PBXBuildFile section */ 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; @@ -52,6 +53,7 @@ 9FDCBF42F42C4D3A90C4FF77 /* OpenSans-Light.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 50CF1CCB91B749748E0C08C7 /* OpenSans-Light.ttf */; }; A62FF9CF326443FB885D7FBD /* libSafariViewManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 54211983D32D4316AE302999 /* libSafariViewManager.a */; }; A77965889D0C4ABAA76C7D1E /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E0083FB0C16F4D6C8C5A1128 /* EvilIcons.ttf */; }; + AAB4EADBDA2046AE9DDC0C6A /* libRNCookieManagerIOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ED00F0F2B2624699A679DFB6 /* libRNCookieManagerIOS.a */; }; B551A74F653048B38D9D2677 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8257ED6670C241A48D707255 /* Entypo.ttf */; }; B83B9C1B275C4114A4A156F6 /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F01012DEC16A4179879AD390 /* SimpleLineIcons.ttf */; }; B8D599F61D2A4797A2F71CAA /* libRNVectorIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AFDBB5669CAB4C5C8215B571 /* libRNVectorIcons.a */; }; @@ -252,6 +254,20 @@ remoteGlobalIDString = 134814201AA4EA6300B7C361; remoteInfo = RNSearchBar; }; + 48F9DE9A1F6DB8C60064194C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 78A0EE19E449476883F58020 /* CodePush.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 6463C8241EBA0CB60095B8CD; + remoteInfo = "CodePush-tvOS"; + }; + 48F9DEBB1F6DB8C60064194C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E14CC94AAEF7467B9AFD7CDB /* RNCookieManagerIOS.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1BD725DA1CF77A8B005DBD79; + remoteInfo = RNCookieManagerIOS; + }; 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; @@ -412,7 +428,9 @@ DC5C35E41E37AD1800F3F526 /* Zocial.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = Zocial.ttf; sourceTree = ""; }; E0083FB0C16F4D6C8C5A1128 /* EvilIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = EvilIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf"; sourceTree = ""; }; E118784082B847BCB75CCABA /* OpenSans-Regular.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "OpenSans-Regular.ttf"; path = "../src/assets/fonts/OpenSans-Regular.ttf"; sourceTree = ""; }; + E14CC94AAEF7467B9AFD7CDB /* RNCookieManagerIOS.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNCookieManagerIOS.xcodeproj; path = "../node_modules/react-native-cookies/ios/RNCookieManagerIOS.xcodeproj"; sourceTree = ""; }; ECD55646AE8E4000BD08BC2D /* Lato-Black.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Lato-Black.ttf"; path = "../src/assets/fonts/Lato-Black.ttf"; sourceTree = ""; }; + ED00F0F2B2624699A679DFB6 /* libRNCookieManagerIOS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNCookieManagerIOS.a; sourceTree = ""; }; EE0605281E45441288EA9435 /* RNDeviceInfo.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNDeviceInfo.xcodeproj; path = "../node_modules/react-native-device-info/RNDeviceInfo.xcodeproj"; sourceTree = ""; }; F01012DEC16A4179879AD390 /* SimpleLineIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = SimpleLineIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf"; sourceTree = ""; }; F471BB4CEC5E4F1FBC1EC566 /* opensans_semibold.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = opensans_semibold.ttf; path = ../src/assets/fonts/opensans_semibold.ttf; sourceTree = ""; }; @@ -451,6 +469,7 @@ 21B7C06027854E159BE31EE1 /* libCodePush.a in Frameworks */, 562B8AA6D1DA4F4C8294AD19 /* libz.tbd in Frameworks */, 03B3A46935444CCDA0302579 /* libRNI18n.a in Frameworks */, + AAB4EADBDA2046AE9DDC0C6A /* libRNCookieManagerIOS.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -623,6 +642,7 @@ isa = PBXGroup; children = ( 273F19201F1E1AD5004B4410 /* libCodePush.a */, + 48F9DE9B1F6DB8C60064194C /* libCodePush.a */, ); name = Products; sourceTree = ""; @@ -643,6 +663,14 @@ name = Products; sourceTree = ""; }; + 48F9DE961F6DB8C60064194C /* Products */ = { + isa = PBXGroup; + children = ( + 48F9DEBC1F6DB8C60064194C /* libRNCookieManagerIOS.a */, + ); + name = Products; + sourceTree = ""; + }; 5E91572E1DD0AC6500FF2AA8 /* Products */ = { isa = PBXGroup; children = ( @@ -690,6 +718,7 @@ 84EAF1F8EA7E4DA69245C813 /* ReactNativeConfig.xcodeproj */, 78A0EE19E449476883F58020 /* CodePush.xcodeproj */, B88D3A8C883A40A8A56A5FA1 /* RNI18n.xcodeproj */, + E14CC94AAEF7467B9AFD7CDB /* RNCookieManagerIOS.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -948,6 +977,10 @@ ProductGroup = 27A36D231F1DDCCE0033CA49 /* Products */; ProjectRef = 84EAF1F8EA7E4DA69245C813 /* ReactNativeConfig.xcodeproj */; }, + { + ProductGroup = 48F9DE961F6DB8C60064194C /* Products */; + ProjectRef = E14CC94AAEF7467B9AFD7CDB /* RNCookieManagerIOS.xcodeproj */; + }, { ProductGroup = DCD1C1341EEF193300E3B03D /* Products */; ProjectRef = EE0605281E45441288EA9435 /* RNDeviceInfo.xcodeproj */; @@ -1148,6 +1181,20 @@ remoteRef = 48F49F661F19026D0012FAD6 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 48F9DE9B1F6DB8C60064194C /* libCodePush.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libCodePush.a; + remoteRef = 48F9DE9A1F6DB8C60064194C /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 48F9DEBC1F6DB8C60064194C /* libRNCookieManagerIOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRNCookieManagerIOS.a; + remoteRef = 48F9DEBB1F6DB8C60064194C /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -1399,11 +1446,15 @@ "$(SRCROOT)/../node_modules/react-native-config/ios/ReactNativeConfig", "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", "$(SRCROOT)/../node_modules/react-native-i18n/ios", + "$(SRCROOT)/../node_modules/react-native-cookies/ios/RNCookieManagerIOS", ); INFOPLIST_FILE = GitPointTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "$(inherited)"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); OTHER_LDFLAGS = ( "-ObjC", "-lc++", @@ -1428,11 +1479,15 @@ "$(SRCROOT)/../node_modules/react-native-config/ios/ReactNativeConfig", "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", "$(SRCROOT)/../node_modules/react-native-i18n/ios", + "$(SRCROOT)/../node_modules/react-native-cookies/ios/RNCookieManagerIOS", ); INFOPLIST_FILE = GitPointTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "$(inherited)"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); OTHER_LDFLAGS = ( "-ObjC", "-lc++", @@ -1462,6 +1517,7 @@ "$(SRCROOT)/../node_modules/react-native-config/ios/ReactNativeConfig", "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", "$(SRCROOT)/../node_modules/react-native-i18n/ios", + "$(SRCROOT)/../node_modules/react-native-cookies/ios/RNCookieManagerIOS", ); INFOPLIST_FILE = GitPoint/Info.plist; INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; @@ -1501,6 +1557,7 @@ "$(SRCROOT)/../node_modules/react-native-config/ios/ReactNativeConfig", "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", "$(SRCROOT)/../node_modules/react-native-i18n/ios", + "$(SRCROOT)/../node_modules/react-native-cookies/ios/RNCookieManagerIOS", ); INFOPLIST_FILE = GitPoint/Info.plist; INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; @@ -1541,10 +1598,14 @@ "$(SRCROOT)/../node_modules/react-native-config/ios/ReactNativeConfig", "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", "$(SRCROOT)/../node_modules/react-native-i18n/ios", + "$(SRCROOT)/../node_modules/react-native-cookies/ios/RNCookieManagerIOS", ); INFOPLIST_FILE = "GitPoint-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "$(inherited)"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); OTHER_LDFLAGS = ( "-ObjC", "-lc++", @@ -1578,10 +1639,14 @@ "$(SRCROOT)/../node_modules/react-native-config/ios/ReactNativeConfig", "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", "$(SRCROOT)/../node_modules/react-native-i18n/ios", + "$(SRCROOT)/../node_modules/react-native-cookies/ios/RNCookieManagerIOS", ); INFOPLIST_FILE = "GitPoint-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "$(inherited)"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); OTHER_LDFLAGS = ( "-ObjC", "-lc++", @@ -1607,7 +1672,10 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "GitPoint-tvOSTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "$(inherited)"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.GitPoint-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; @@ -1629,7 +1697,10 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "GitPoint-tvOSTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "$(inherited)"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.GitPoint-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; diff --git a/package.json b/package.json index 08c906fa6..affec71d6 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "react-native-code-push": "^5.0.0-beta", "react-native-communications": "^2.2.1", "react-native-config": "^0.6.0", + "react-native-cookies": "^3.2.0", "react-native-device-info": "^0.11.0", "react-native-elements": "^0.9.3", "react-native-htmlview": "^0.12.0", diff --git a/root.store.js b/root.store.js index ae7e37bdf..f45bb1b9a 100644 --- a/root.store.js +++ b/root.store.js @@ -35,7 +35,10 @@ if (__DEV__ && process.env.TRON_ENABLED) { compose(getMiddleware(), ...getEnhancers()) ); } else { - store = createStore(rootReducer, composeWithDevTools(getMiddleware(), ...getEnhancers())); + store = createStore( + rootReducer, + composeWithDevTools(getMiddleware(), ...getEnhancers()) + ); } export const configureStore = store; diff --git a/src/auth/screens/auth-profile.screen.js b/src/auth/screens/auth-profile.screen.js index db1399ecd..c73f3fdd7 100644 --- a/src/auth/screens/auth-profile.screen.js +++ b/src/auth/screens/auth-profile.screen.js @@ -33,11 +33,15 @@ const mapStateToProps = state => ({ hasInitialUser: state.auth.hasInitialUser, }); -const mapDispatchToProps = dispatch => bindActionCreators({ - getUser, - getOrgs, - getStarCount, -}, dispatch); +const mapDispatchToProps = dispatch => + bindActionCreators( + { + getUser, + getOrgs, + getStarCount, + }, + dispatch + ); const styles = StyleSheet.create({ listTitle: { diff --git a/src/auth/screens/events.screen.js b/src/auth/screens/events.screen.js index 3bcef8b55..f129a6575 100644 --- a/src/auth/screens/events.screen.js +++ b/src/auth/screens/events.screen.js @@ -18,9 +18,13 @@ const mapStateToProps = state => ({ isPendingEvents: state.auth.isPendingEvents, }); -const mapDispatchToProps = dispatch => bindActionCreators({ - getUserEvents, -}, dispatch); +const mapDispatchToProps = dispatch => + bindActionCreators( + { + getUserEvents, + }, + dispatch + ); const styles = StyleSheet.create({ descriptionContainer: { diff --git a/src/auth/screens/login.screen.js b/src/auth/screens/login.screen.js index 796e8ca56..184e950e0 100644 --- a/src/auth/screens/login.screen.js +++ b/src/auth/screens/login.screen.js @@ -2,17 +2,26 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; -import { Linking, View, StyleSheet, Text, Platform, Image } from 'react-native'; +import { + ActivityIndicator, + View, + StyleSheet, + Text, + Linking, + Image, + WebView, + Platform, + Modal, +} from 'react-native'; import { Button, Icon } from 'react-native-elements'; -import SafariView from 'react-native-safari-view'; import AppIntro from 'react-native-app-intro'; import queryString from 'query-string'; -import { ViewContainer, LoadingContainer } from 'components'; +import { ViewContainer } from 'components'; import { colors, fonts, normalize } from 'config'; import { CLIENT_ID } from 'api'; import { auth } from 'auth'; -import { openURLInView, translate } from 'utils'; +import { translate } from 'utils'; const stateRandom = Math.random().toString(); @@ -49,6 +58,28 @@ const styles = StyleSheet.create({ ...fonts.fontPrimaryBold, fontSize: normalize(12), }, + browserDismiss: { + flex: 1, + }, + browserLoader: { + flex: 1, + position: 'absolute', + justifyContent: 'center', + alignItems: 'center', + height: '100%', + width: '100%', + textAlign: 'center', + backgroundColor: colors.githubDark, + }, + browserLoadingLabel: { + fontSize: normalize(20), + color: colors.white, + ...fonts.fontPrimarySemiBold, + paddingBottom: 20, + }, + browserSection: { + flex: 5, + }, logo: { width: 90, height: 90, @@ -58,6 +89,11 @@ const styles = StyleSheet.create({ justifyContent: 'center', alignItems: 'center', }, + modalContainer: { + flex: 1, + paddingTop: 20, + backgroundColor: '#1f2327', + }, contentSection: { flex: 2, justifyContent: 'center', @@ -114,11 +150,14 @@ class Login extends Component { this.state = { code: null, + modalVisible: false, + cancelDisabled: false, + showLoader: true, + loaderText: translate('auth.login.connectingToGitHub', this.language), asyncStorageChecked: false, }; } - // Set up Linking componentDidMount() { if (this.props.isAuthenticated) { this.props.navigation.navigate('Main'); @@ -127,39 +166,69 @@ class Login extends Component { // eslint-disable-next-line react/no-did-mount-set-state this.setState({ asyncStorageChecked: true }); - Linking.addEventListener('url', this.handleOpenURL); - Linking.getInitialURL().then(url => { - if (url) { - this.handleOpenURL({ url }); - } - }); + if (Platform.OS === 'android') { + Linking.addEventListener('url', this.handleOpenURL); + Linking.getInitialURL().then(url => { + if (url) { + this.handleOpenURL({ url }); + } + }); + } } } componentWillUnmount() { - Linking.removeEventListener('url', this.handleOpenURL); + if (Platform.OS === 'android') { + Linking.removeEventListener('url', this.handleOpenURL); + } } - handleOpenURL = ({ url }) => { - const [, queryStringFromUrl] = url.match(/\?(.*)/); - const { state, code } = queryString.parse(queryStringFromUrl); - const { auth, navigation } = this.props; + onNavigationStateChange = navState => { + const url = navState.url; + + this.handleOpenURL({ url }); + }; + + setModalVisible = visible => { + this.setState({ modalVisible: visible }); + }; - if (stateRandom === state) { - this.setState({ code }); + toggleCancelButton = (e, disabled) => { + const url = e.nativeEvent.url; - auth(code, state, navigation); + if (url === 'https://github.com/session') { + this.setState({ cancelDisabled: disabled }); } + }; + + handleOpenURL = ({ url }) => { + if (url && url.substring(0, 11) === 'gitpoint://') { + const [, queryStringFromUrl] = url.match(/\?(.*)/); + const { state, code } = queryString.parse(queryStringFromUrl); + const { auth, navigation } = this.props; - if (Platform.OS === 'ios') { - SafariView.dismiss(); + if (stateRandom === state) { + this.setState({ + code, + showLoader: true, + loaderText: translate('auth.login.preparingGitPoint', this.language), + }); + + auth(code, state, navigation); + } } }; - signIn = () => - openURLInView( - `https://github.com/login/oauth/authorize?response_type=token&client_id=${CLIENT_ID}&redirect_uri=gitpoint://welcome&scope=user%20repo&state=${stateRandom}` + renderLoading() { + return ( + + + {this.state.loaderText} + + + ); + } render() { const { language, isLoggingIn, isAuthenticated } = this.props; @@ -167,99 +236,141 @@ class Login extends Component { return ( {!isAuthenticated && - this.state.asyncStorageChecked && ( - - - + !isLoggingIn && + this.state.asyncStorageChecked && + + null} + visible={this.state.modalVisible} + style={styles.container} + > + + + this.toggleCancelButton(e, true)} + onLoadEnd={e => this.toggleCancelButton(e, false)} + onNavigationStateChange={e => + this.onNavigationStateChange(e)} + renderLoading={() => this.renderLoading()} + startInLoadingState + /> + + +