diff --git a/mobile-ui/components/AreaComun.js b/mobile-ui/components/AreaComun.js
index 80256919..42d0d224 100644
--- a/mobile-ui/components/AreaComun.js
+++ b/mobile-ui/components/AreaComun.js
@@ -20,13 +20,10 @@ export default function AreaComun({navigation}){
const [service, setService] = useState("");
const [areas, setAreas] = useState([])
const [isRequesting, setIsRequesting] = useState(false);
- const [selectedHours, setSelectedHours] = useState(0);
- const [selectedMinutes, setSelectedMinutes] = useState(0);
- const [endSelectedHours, setEndSelectedHours] = useState(0);
- const [endSelectedMinutes, setEndSelectedMinutes] = useState(0);
const [time, setTime] = useState(new Date())
- const [endTime, setEndTime] = useState(new Date())
+ const idComunidad = user.community_id
const date = new Date();
+ const [mode, setMode] = useState('time');
useEffect(() => {
@@ -36,7 +33,7 @@ export default function AreaComun({navigation}){
try {
- const jsonResponse = await fetch(`${API.BASE_URL}/commonArea/allCommonAreas`, {
+ const jsonResponse = await fetch(`${API.BASE_URL}/commonArea/findByCommunity/` + `${idComunidad}`, {
method: "GET",
headers: {
'Content-Type': 'application/json'
@@ -44,7 +41,7 @@ export default function AreaComun({navigation}){
})
const response = await jsonResponse.json();
- console.log(response.message);
+ // console.log(response.message);
setAreas(response.message);
@@ -102,16 +99,10 @@ export default function AreaComun({navigation}){
const onChangeStart = (event, selectedDate) => {
- const currentDate = selectedDate;
- setShow(false);
+ const currentDate = selectedDate || time;
+
setTime(currentDate);
};
- const onChangeEnd = (event, selectedDate) => {
- const currentDate = selectedDate;
- setShow(false);
- setEndTime(currentDate);
- };
-
return (
diff --git a/mobile-ui/components/Profile.js b/mobile-ui/components/Profile.js
index b8904eff..baeb64ad 100644
--- a/mobile-ui/components/Profile.js
+++ b/mobile-ui/components/Profile.js
@@ -4,7 +4,7 @@ import {
Box, Button,
Center, FormControl, Heading, ScrollView, VStack
} from "native-base";
-import { Dimensions, StyleSheet, TextInput, useWindowDimensions } from "react-native";
+import { StyleSheet, TextInput, useWindowDimensions } from "react-native";
import { UserContext } from "../context/UserContext";
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
import { stringMd5 } from 'react-native-quick-md5';
@@ -14,7 +14,7 @@ const { Navigator, Screen } = createMaterialTopTabNavigator();
export default function Profile({ navigation }) {
- const baseURL = `${API.BASE_URL}/user/updateGuarda/`
+ const baseURL = `${API.BASE_URL}/user/updateUser/`
const [index, setIndex] = useState(0);
const layout = useWindowDimensions();
const userData = useContext(UserContext)
@@ -22,6 +22,7 @@ export default function Profile({ navigation }) {
const [apellido, setApellido] =useState(userData.user.last_name);
const [email, setEmail] = useState(userData.user.email);
const [password, setPassword] = useState();
+ const [confirmPassword, setConfirmPassword] = useState()
const id = userData.user._id;
const decode = userData.Password;
const [error, setError] = useState({})
@@ -132,7 +133,7 @@ export default function Profile({ navigation }) {
Confirmar nueva contraseƱa
- setPassword(value) }/>
+ setConfirmPassword(value) }/>