|
@ -4,7 +4,6 @@ import moment from "moment"; |
|
|
import Screen from '../components/Screen'; |
|
|
import Screen from '../components/Screen'; |
|
|
import SearchablePicker from '../components/SearchablePicker'; |
|
|
import SearchablePicker from '../components/SearchablePicker'; |
|
|
import FormDatePicker from '../components/forms/FormDatePicker'; |
|
|
import FormDatePicker from '../components/forms/FormDatePicker'; |
|
|
import institutions from "../assets/institutions"; |
|
|
|
|
|
import defaultStyles from "../config/styles"; |
|
|
import defaultStyles from "../config/styles"; |
|
|
import constants from "../config/constants"; |
|
|
import constants from "../config/constants"; |
|
|
import ConfirmationModal from '../components/ConfirmationModal'; |
|
|
import ConfirmationModal from '../components/ConfirmationModal'; |
|
@ -19,6 +18,7 @@ import { states, statesToCities } from "../assets/cities_states"; |
|
|
import PasswordFormField from "../components/forms/PasswordFormField"; |
|
|
import PasswordFormField from "../components/forms/PasswordFormField"; |
|
|
import storage from "../auth/storage"; |
|
|
import storage from "../auth/storage"; |
|
|
import { AuthContext } from "../auth/context"; |
|
|
import { AuthContext } from "../auth/context"; |
|
|
|
|
|
import { getInstitutions } from "../api/fetchInstutions"; |
|
|
|
|
|
|
|
|
//#region PICKERS
|
|
|
//#region PICKERS
|
|
|
|
|
|
|
|
@ -27,6 +27,16 @@ function InstitutionNamePicker({ name }) { |
|
|
const state = values["state"]; |
|
|
const state = values["state"]; |
|
|
const instType = values["institution"]; |
|
|
const instType = values["institution"]; |
|
|
const [items, setItems] = useState([]); |
|
|
const [items, setItems] = useState([]); |
|
|
|
|
|
const [institutions, setInstitutions] = useState([]); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
getInstitutions().then((data) => { |
|
|
|
|
|
setInstitutions(data); |
|
|
|
|
|
}) |
|
|
|
|
|
.catch((error) => { |
|
|
|
|
|
console.error(error); |
|
|
|
|
|
}); |
|
|
|
|
|
}, []); |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
try { |
|
|
try { |
|
@ -123,11 +133,11 @@ function CityPicker({ name }) { |
|
|
|
|
|
|
|
|
function InstitutionPicker({ name }) { |
|
|
function InstitutionPicker({ name }) { |
|
|
const [items, setItems] = useState([ |
|
|
const [items, setItems] = useState([ |
|
|
{ value: "E", label: "Escola" }, |
|
|
|
|
|
{ value: "D", label: "Defesa civil" }, |
|
|
|
|
|
{ value: "N", label: "Não governamental" }, |
|
|
|
|
|
{ value: "O", label: "Outra" }, |
|
|
|
|
|
{ value: "X", label: "Nenhuma" }, |
|
|
|
|
|
|
|
|
{ value: "SCHOOL", label: "Escola" }, |
|
|
|
|
|
{ value: "CIVIL_DEFENSE", label: "Defesa civil" }, |
|
|
|
|
|
{ value: "NGO", label: "Não governamental" }, |
|
|
|
|
|
{ value: "OTHER", label: "Outra" }, |
|
|
|
|
|
{ value: "X", label: "Nenhuma" } |
|
|
]); |
|
|
]); |
|
|
return ( |
|
|
return ( |
|
|
<SearchablePicker |
|
|
<SearchablePicker |
|
|