2024-03-22 23:41:51 +01:00
|
|
|
import { Redirect } from "expo-router"
|
|
|
|
|
|
|
|
import { useAuthentication } from "@/presentation/react/contexts/Authentication"
|
2024-02-16 22:51:50 +01:00
|
|
|
|
|
|
|
const HomePage: React.FC = () => {
|
2024-03-22 23:41:51 +01:00
|
|
|
const { user } = useAuthentication()
|
2024-02-16 22:51:50 +01:00
|
|
|
|
2024-03-22 23:41:51 +01:00
|
|
|
if (user == null) {
|
2024-03-23 01:43:27 +01:00
|
|
|
return <Redirect href="/authentication/login" />
|
2024-03-22 23:41:51 +01:00
|
|
|
}
|
|
|
|
|
2024-03-23 01:43:27 +01:00
|
|
|
return <Redirect href="/application/habits/" />
|
2024-03-22 23:41:51 +01:00
|
|
|
}
|
2024-02-16 22:51:50 +01:00
|
|
|
|
|
|
|
export default HomePage
|