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
<TouchableOpacity onPressIn={this.addOne} onPressOut={this.stopTimer}> | |
<Icon name="plus-circle" size={30} color={'white'} /> | |
</TouchableOpacity> |
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
constructor() { | |
super(); | |
this.state = { | |
number: 0, | |
}; | |
this.timer = null; | |
this.addOne = this.addOne.bind(this); | |
this.stopTimer = this.stopTimer.bind(this); | |
} |
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
export function loginWithFacebook(accessToken){ | |
return (dispatch,_,firebaseApp)=>{ | |
dispatch({ type: LOGGING_IN}); | |
const credential = firebase.auth.FacebookAuthProvider.credential(accessToken); | |
firebaseApp.auth().signInWithCredential(credential).then((user) => { | |
dispatch({ type: LOGGED_IN, user }); | |
}).catch((error) => { | |
console.log(error); | |
}); | |
} |
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
<LoginButton | |
publishPermissions={["publish_actions"]} | |
onLoginFinished={ | |
(error, result) => { | |
if (error) { | |
alert("login has error: " + result.error); | |
} else if (result.isCancelled) { | |
alert("login is cancelled."); | |
} else { | |
AccessToken.getCurrentAccessToken().then( |
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
export function checkUser() { | |
return (dispatch, getState, firebase) => { | |
firebase.auth().onAuthStateChanged((user) => { | |
if (user) { | |
dispatch({ type: LOGIN, user }); | |
} else { | |
dispatch({ type: LOGOUT }); | |
} | |
}); | |
}; |
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
export function loginWithEmail(email, password){ | |
return (dispatch,_,firebaseApp)=>{ | |
dispatch({ type: LOGGING_IN}); | |
firebaseApp.auth().signInWithEmailAndPassword(email, password) | |
.then((user) => { | |
dispatch({ type: LOGGED_IN, user }); | |
}) | |
.catch(err => dispatch({ type: ERROR, error: err.toString() })); | |
}; | |
} |
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
export function registerWithEmail(email, password){ | |
return (dispatch,_,firebaseApp)=>{ | |
dispatch({ type: CREATING_ACCOUNT}); | |
firebaseApp.auth().createUserWithEmailAndPassword(email, password) | |
.then((user) => { | |
dispatch({ type: CREATED_ACCOUNT, user }); | |
user.sendEmailVerification(); | |
}) | |
.catch(err => dispatch({ type: ERROR, error: err.toString() })); | |
}; |
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
import { Model} from 'objection'; | |
export default class RootModel extends Model { | |
static get generateGraphSchema(){ | |
const required = {}, relations = {},convertType = (type) => { | |
switch (type) { | |
case 'string': return 'String'; | |
case 'integer': return 'Int'; | |
case 'number': return 'Float'; | |
case 'boolean': return 'Boolean'; |
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
//@flow | |
import React, { Component,PropTypes } from 'react'; | |
import { | |
StyleSheet, | |
TextInput, | |
View, | |
Text, | |
ListView, |
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
//@flow | |
import React, { Component,PropTypes } from 'react'; | |
import { | |
Platform, | |
StyleSheet, | |
TextInput, | |
View, | |
Text, | |
TouchableNativeFeedback, |