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 |
67b916af
|
Fantič
|
import LoadingBox from "../components/loading/LoadingBox"
|
7 |
ddc84a2f
|
Schwobik
|
|
8 |
|
|
const Logout = () => {
|
9 |
|
|
const dispatch = useDispatch<AppDispatch>();
|
10 |
|
|
|
11 |
|
|
useEffect(() => {
|
12 |
|
|
dispatch(logout())
|
13 |
06808454
|
Schwobik
|
}, [])
|
14 |
ddc84a2f
|
Schwobik
|
|
15 |
|
|
return (
|
16 |
67b916af
|
Fantič
|
<LoadingBox text="Logging out..."/>
|
17 |
ddc84a2f
|
Schwobik
|
)
|
18 |
|
|
}
|
19 |
|
|
|
20 |
|
|
export default Logout
|