From 8efb6d940a602e4615fc96abe3f82da02f3492ee Mon Sep 17 00:00:00 2001 From: Stephen Saunders Date: Mon, 25 Jan 2016 18:55:38 -0800 Subject: [PATCH 1/3] adding changes to --- .gitignore | 1 + Client/ios/Lantern.xcodeproj/project.pbxproj | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ed9c45f..e5f1d8d 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ node_modules/ bower_components/ keys.sh +Client/ios/Lantern.xcodeproj/project.pbxproj diff --git a/Client/ios/Lantern.xcodeproj/project.pbxproj b/Client/ios/Lantern.xcodeproj/project.pbxproj index 1227776..6f1e1ca 100644 --- a/Client/ios/Lantern.xcodeproj/project.pbxproj +++ b/Client/ios/Lantern.xcodeproj/project.pbxproj @@ -436,7 +436,7 @@ TestTargetID = 13B07F861A680F5B00A75B9A; }; 13B07F861A680F5B00A75B9A = { - DevelopmentTeam = P6SKWH9N8E; + DevelopmentTeam = EGN2S7YVJH; SystemCapabilities = { com.apple.Maps.iOS = { enabled = 1; From 07607ee4fb479d15056b86d135bc44fab8a0ea17 Mon Sep 17 00:00:00 2001 From: Stephen Saunders Date: Mon, 25 Jan 2016 20:27:47 -0800 Subject: [PATCH 2/3] Implement basic navigator --- .../Facebook/{Login.js => Login-button.js} | 0 Client/Src/Facebook/Signin.js | 33 +++++++++++++++++++ Client/Src/main.js | 30 ++++++++++------- Client/Src/styles.js | 7 ++-- Client/index.ios.js | 6 +--- 5 files changed, 57 insertions(+), 19 deletions(-) rename Client/Src/Facebook/{Login.js => Login-button.js} (100%) create mode 100644 Client/Src/Facebook/Signin.js diff --git a/Client/Src/Facebook/Login.js b/Client/Src/Facebook/Login-button.js similarity index 100% rename from Client/Src/Facebook/Login.js rename to Client/Src/Facebook/Login-button.js diff --git a/Client/Src/Facebook/Signin.js b/Client/Src/Facebook/Signin.js new file mode 100644 index 0000000..5d5e376 --- /dev/null +++ b/Client/Src/Facebook/Signin.js @@ -0,0 +1,33 @@ +'use strict'; + +var React = require('react-native'); +var { + StyleSheet, + Text, + View, +} = React; + +var Login = require('./Login-button'); + +/** + * A sample app that demonstrates use of the FBSDK login button, native share dialog, and graph requests. + */ +var Signin = React.createClass({ + componentDidMount: function(){ + console.log('IN SIGNIN COMPONENT WILL MOUNT'); + }, + render: function() { + return ( + + {console.log('IN SIGIN Render')} + We dont need no stinking image background yet!! + + + ); + } +}); + +// importing styles +var styles = StyleSheet.create(require('../styles.js')); + +module.exports = Signin; diff --git a/Client/Src/main.js b/Client/Src/main.js index 1a847dc..19e4a9b 100644 --- a/Client/Src/main.js +++ b/Client/Src/main.js @@ -1,27 +1,33 @@ var React = require('react-native'); var { - AppRegistry, StyleSheet, - Text, - View, - Image, + Navigator } = React; -var Login = require('./Facebook/Login'); +var Signin = require('./Facebook/Signin'); + +var ROUTES = { + signin: Signin +}; /** * A sample app that demonstrates use of the FBSDK login button, native share dialog, and graph requests. */ var Main = React.createClass({ + renderScene: function(route, navigator){ + var Component = ROUTES[route.name]; + return ; + }, render: function() { return ( - - - We dont need no stinking image background yet!! - - {/*this is the log in button*/} - - + { + console.log('TETETETET', Navigator.SceneConfigs.FloatFromRight) + return Navigator.SceneConfigs.FloatFromRight; }} + /> ); } }); diff --git a/Client/Src/styles.js b/Client/Src/styles.js index 801830b..861cade 100644 --- a/Client/Src/styles.js +++ b/Client/Src/styles.js @@ -1,5 +1,3 @@ - - 'use strict'; module.exports = { @@ -9,6 +7,10 @@ module.exports = { alignItems: 'center', }, + navigator: { + flex: 1 + }, + textContainer: { alignItems: 'center', justifyContent: 'center', @@ -28,6 +30,7 @@ module.exports = { shadowColor: '#000000', shadowOpacity: 1, shadowOffset: {width: 0, height: 0}, + borderRadius: 10 }, text: { diff --git a/Client/index.ios.js b/Client/index.ios.js index 4e4a06b..19513d7 100644 --- a/Client/index.ios.js +++ b/Client/index.ios.js @@ -2,11 +2,7 @@ var React = require('react-native'); var { - AppRegistry, - StyleSheet, - Text, - View, - Image, + AppRegistry } = React; var Main = require('./Src/main'); From ad6540bad61020612d4c173983601720626e78fd Mon Sep 17 00:00:00 2001 From: Stephen Saunders Date: Mon, 25 Jan 2016 21:48:22 -0800 Subject: [PATCH 3/3] Login transitions automatically to home when logged in --- Client/Src/Facebook/Login-button.js | 15 +++++++++++---- Client/Src/Facebook/Signin.js | 6 +----- Client/Src/Home/Home.js | 26 ++++++++++++++++++++++++++ Client/Src/main.js | 5 +++-- 4 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 Client/Src/Home/Home.js diff --git a/Client/Src/Facebook/Login-button.js b/Client/Src/Facebook/Login-button.js index 7e8a45a..9068d4d 100644 --- a/Client/Src/Facebook/Login-button.js +++ b/Client/Src/Facebook/Login-button.js @@ -16,6 +16,14 @@ var { } = FBSDKCore; var Login = React.createClass({ + componentDidMount: function() { + FBSDKAccessToken.getCurrentAccessToken((result) => { + if (result) { + this.props.navigator.push({name: 'home'}); + } + }) + }, + render: function() { return ( @@ -40,14 +48,13 @@ var Login = React.createClass({ if (result.isCancelled) { alert('Login cancelled.'); } else { - alert('Logged in.'); - console.log('logging result',result); + this.props.navigator.push({ name: 'home'}) } } {/*calling function again to get acess token after log in*/} FBSDKAccessToken.getCurrentAccessToken((data) => { - console.log('data',data); - }); + console.log('data',data); + }); } } diff --git a/Client/Src/Facebook/Signin.js b/Client/Src/Facebook/Signin.js index 5d5e376..21f0b41 100644 --- a/Client/Src/Facebook/Signin.js +++ b/Client/Src/Facebook/Signin.js @@ -13,15 +13,11 @@ var Login = require('./Login-button'); * A sample app that demonstrates use of the FBSDK login button, native share dialog, and graph requests. */ var Signin = React.createClass({ - componentDidMount: function(){ - console.log('IN SIGNIN COMPONENT WILL MOUNT'); - }, render: function() { return ( - {console.log('IN SIGIN Render')} We dont need no stinking image background yet!! - + ); } diff --git a/Client/Src/Home/Home.js b/Client/Src/Home/Home.js new file mode 100644 index 0000000..8406521 --- /dev/null +++ b/Client/Src/Home/Home.js @@ -0,0 +1,26 @@ +'use strict'; + +var React = require('react-native'); +var { + StyleSheet, + Text, + View, +} = React; + +/** + * A sample app that demonstrates use of the FBSDK login button, native share dialog, and graph requests. + */ +var Home = React.createClass({ + render: function() { + return ( + + let me do it as it would be on the home screen + + ); + } +}); + +// importing styles +var styles = StyleSheet.create(require('../styles.js')); + +module.exports = Home; diff --git a/Client/Src/main.js b/Client/Src/main.js index 19e4a9b..884d1f1 100644 --- a/Client/Src/main.js +++ b/Client/Src/main.js @@ -5,9 +5,11 @@ var { } = React; var Signin = require('./Facebook/Signin'); +var Home = require('./Home/Home'); var ROUTES = { - signin: Signin + signin: Signin, + home: Home }; /** @@ -25,7 +27,6 @@ var Main = React.createClass({ initialRoute={{name: 'signin'}} renderScene={this.renderScene} configureScene={() => { - console.log('TETETETET', Navigator.SceneConfigs.FloatFromRight) return Navigator.SceneConfigs.FloatFromRight; }} /> );