Created
January 14, 2019 16:53
-
-
Save aloukissas/75213d6946ce1173d488e3addee8d7ce to your computer and use it in GitHub Desktop.
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 React from "react"; | |
import { View, Text, StyleSheet, Button } from "react-native"; | |
import { Auth } from "aws-amplify"; | |
import { withAuthContext } from "../context"; | |
class Home extends React.Component { | |
handleLogout = async () => { | |
await Auth.signOut(); | |
this.props.auth.setAuthenticated(false); | |
}; | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Button title="Logout" onPress={this.handleLogout} /> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
alignItems: "center", | |
justifyContent: "center" | |
} | |
}); | |
export default withAuthContext(Home); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment