| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- import React, { useContext, ChangeEvent, FC } from "react";
- import Select from "../UI/forms/select";
- // import DegreeDay from "../data/DegreeDay";
- // import TemperaturePerSeason from "../data/TemperaturePerSeason";
- import TemperaturePerSector from "../data/TemperaturePerSector";
- // import Precipitation from "../data/Precipitation";
- import CalendarInput from "../UI/forms/calendarInput";
- import { UserStateContext } from "../../context/auth/AuthProvider";
- import DashboardProvider from "../../context/dashboard/Provider";
- import { Redirect } from "react-router-dom";
- import Layout from "../layout";
- const Home: FC = () => {
- let fincaList: string[] | number[] = ["a", "b", "c", "d"];
- let campaignList: string[] | number[] = ["2018", "2019", "2020", "2021"];
- const userState = useContext(UserStateContext);
- if (!userState.loggedIn) {
- return <Redirect to="/login" />;
- }
- return (
- <>
- <Layout>
- <DashboardProvider>
- <section className="row p-lg-4 p-md-3 p-2">
- <div className="col-12 col-lg-4 mb-2 col-xl-3 mb-xl-0">
- <Select
- list={fincaList}
- onChange={(e: ChangeEvent<HTMLInputElement>) =>
- console.log(e.target.value)
- }
- name="Comparación"
- placeholder="Fincas"
- />
- </div>
- <div className="col-6 col-lg-4 mb-2 col-xl-auto mb-xl-0">
- <CalendarInput
- onChange={(e: ChangeEvent<HTMLInputElement>) =>
- console.log(e.target.value)
- }
- name="Comparación"
- />
- </div>
- <div className="col-6 col-lg-4 mb-2 col-xl-auto mb-xl-0">
- <CalendarInput
- onChange={(e: ChangeEvent<HTMLInputElement>) =>
- console.log(e.target.value)
- }
- name="Comparación"
- />
- </div>
- <div className="col-6 col-lg-4 mb-2 col-xl-auto mb-xl-0">
- <Select
- list={campaignList}
- onChange={(e: ChangeEvent<HTMLInputElement>) =>
- console.log(e.target.value)
- }
- name="Comparación"
- placeholder="Año historicos"
- />
- </div>
- <div className="col-auto">
- <button type="button" className="btn btn-primary">
- Aplicar
- </button>
- </div>
- </section>
- <section className="row">
- {/* <div className="col-xl-6"> */}
- {/* <TemperaturePerSeason /> */}
- {/* <DegreeDay */}
- {/* title={"Vista flores"} */}
- {/* periodString={"1ro Octubre - 31 Marzo"} */}
- {/* /> */}
- {/* <Precipitation */}
- {/* title={"Maipú"} */}
- {/* periodString={"1ro Octubre - 31 Marzo"} */}
- {/* /> */}
- {/* </div> */}
- <div className="col-xl-6">
- <TemperaturePerSector />
- </div>
- </section>
- </DashboardProvider>
- </Layout>
- </>
- );
- };
- export default Home;
|