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