diff --git a/mobile-ui/components/Profile.js b/mobile-ui/components/Profile.js index 55837943..c5794743 100644 --- a/mobile-ui/components/Profile.js +++ b/mobile-ui/components/Profile.js @@ -7,6 +7,7 @@ import { import { Dimensions, 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'; const { Navigator, Screen } = createMaterialTopTabNavigator(); @@ -19,19 +20,18 @@ export default function Profile({ navigation }) { const [password, setPassword] = useState(); const [index, setIndex] = useState(0); const layout = useWindowDimensions(); - - // const [routes] = useState([{ - // key: "first", - // title: 'Información' - // }, { - // key: "second", - // title: 'Contraseña'}]) - const userData = useContext(UserContext) const id = userData.user._id; + const decode = userData.Password; console.log(userData.user); + const onHandleChangePassword = (value) => { + console.log(value); + const dpassword = stringMd5(value) + console.log(dpassword); + } + const ProfileView = () => ( Contraseña actual - setPassword(value) }/> + onHandleChangePassword(value) }/> Nueva Contraseña @@ -131,40 +131,9 @@ export default function Profile({ navigation }) { ) - // const initialLayout = { - // width: Dimensions.get('window').width - // } - - // const renderScene = SceneMap({ - // first: ProfileView, - // second: PasswordView - // }) - - - // const renderTabBar = props => { - // const inputRange = props.navigationState.routes.map((x, i) => i); - // return - // {props.navigationState.routes.map((route, i) => { - // const opacity = props.position.interpolate({ - // inputRange, - // outputRange: inputRange.map(inputIndex => inputIndex === i ? 1 : 0.5) - // }); - // const color = index === i ? useColorModeValue('#000', '#e5e5e5') : useColorModeValue('#1f2937', '#a1a1aa'); - // const borderColor = index === i ? 'cyan.500' : useColorModeValue('coolGray.200', 'gray.400'); - // return - // { - // console.log(i); - // setIndex(i); - // }}> - // {route.title} - // - // ; - // })} - // ; - // }; + const updatePassword = async() =>{ + } const updateInfo = async() => { diff --git a/mobile-ui/components/ReservasCard/index.js b/mobile-ui/components/ReservasCard/index.js index c255f3de..d2a23b32 100644 --- a/mobile-ui/components/ReservasCard/index.js +++ b/mobile-ui/components/ReservasCard/index.js @@ -1,6 +1,6 @@ import { format } from "date-fns"; import { - Box, HStack, + Box, ScrollView, Text, Stack, diff --git a/mobile-ui/package.json b/mobile-ui/package.json index dec3d08f..8576d722 100644 --- a/mobile-ui/package.json +++ b/mobile-ui/package.json @@ -34,6 +34,7 @@ "react-native": "0.64.3", "react-native-gesture-handler": "~2.1.0", "react-native-pager-view": "5.4.9", + "react-native-quick-md5": "^3.0.4", "react-native-reanimated": "~2.3.1", "react-native-safe-area-context": "3.3.2", "react-native-screens": "~3.10.1",