add addrainfall on home

This commit is contained in:
Romulus21
2024-04-22 22:23:59 +02:00
parent 2f260555cb
commit 2f2077497d
4 changed files with 35 additions and 26 deletions

View File

@@ -1,16 +1,22 @@
import React from "react"
import React, {useState} from "react"
import useAuthUser from "../hooks/AuthUser"
import YearRainfall from "../components/rainfall/YearRainfaill"
import PageLayout from "../components/PageLayout"
import AddRainfall from "../components/rainfall/AddRainfall"
const Home = () => {
const {authUser} = useAuthUser()
const [loadedAt, reload] = useState(new Date)
return <div>
{authUser
? <PageLayout>
<YearRainfall />
<div className="flex flex-col gap-2">
<YearRainfall loadedAt={loadedAt} />
<AddRainfall reload={reload}/>
</div>
</PageLayout>
: <div className="px-5 pt-10">
<h1 className="text-lg font-bold">Application pour enregistrer sa pluviométrie</h1>