1 |
ddc84a2f
|
Schwobik
|
import { useDispatch } from "react-redux"
|
2 |
|
|
import { useEffect } from "react"
|
3 |
|
|
import { AppDispatch } from "../stores/store"
|
4 |
06808454
|
Schwobik
|
import { Center, Heading, HStack, Spinner } from "native-base"
|
5 |
|
|
import { logout } from "../stores/actions/userThunks"
|
6 |
ddc84a2f
|
Schwobik
|
|
7 |
|
|
const Logout = () => {
|
8 |
|
|
const dispatch = useDispatch<AppDispatch>();
|
9 |
|
|
|
10 |
|
|
useEffect(() => {
|
11 |
|
|
dispatch(logout())
|
12 |
06808454
|
Schwobik
|
}, [])
|
13 |
ddc84a2f
|
Schwobik
|
|
14 |
|
|
return (
|
15 |
06808454
|
Schwobik
|
<Center justifyContent={"center"}>
|
16 |
ddc84a2f
|
Schwobik
|
<HStack space={2} justifyContent="center">
|
17 |
|
|
<Spinner
|
18 |
|
|
accessibilityLabel="Loading logout"
|
19 |
06808454
|
Schwobik
|
color="primary.500"
|
20 |
ddc84a2f
|
Schwobik
|
/>
|
21 |
06808454
|
Schwobik
|
<Heading color="primary.500" fontSize="md">
|
22 |
ddc84a2f
|
Schwobik
|
Loading
|
23 |
|
|
</Heading>
|
24 |
|
|
</HStack>
|
25 |
06808454
|
Schwobik
|
</Center>
|
26 |
ddc84a2f
|
Schwobik
|
)
|
27 |
|
|
}
|
28 |
|
|
|
29 |
|
|
export default Logout
|