Skip to content
This repository was archived by the owner on Jul 22, 2026. It is now read-only.

Commit 3f645ca

Browse files
sign out
1 parent 25b6d61 commit 3f645ca

1 file changed

Lines changed: 29 additions & 7 deletions

File tree

screens/Home.js

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,32 @@
1-
import React from 'react'
1+
import React, { Component } from 'react'
22
import { StyleSheet, Text, View } from 'react-native'
3+
import { Button } from 'react-native-elements'
4+
import { withFirebaseHOC } from '../config/Firebase'
35

4-
export default function Home() {
5-
return (
6-
<View style={styles.container}>
7-
<Text>Home</Text>
8-
</View>
9-
)
6+
class Home extends Component {
7+
handleSignout = async () => {
8+
try {
9+
await this.props.firebase.signOut()
10+
this.props.navigation.navigate('Auth')
11+
} catch (error) {
12+
console.log(error)
13+
}
14+
}
15+
render() {
16+
return (
17+
<View style={styles.container}>
18+
<Text>Home</Text>
19+
<Button
20+
title='Signout'
21+
onPress={this.handleSignout}
22+
titleStyle={{
23+
color: '#F57C00'
24+
}}
25+
type='clear'
26+
/>
27+
</View>
28+
)
29+
}
1030
}
1131

1232
const styles = StyleSheet.create({
@@ -17,3 +37,5 @@ const styles = StyleSheet.create({
1737
justifyContent: 'center'
1838
}
1939
})
40+
41+
export default withFirebaseHOC(Home)

0 commit comments

Comments
 (0)