Typos, iOS player and reset password

This commit is contained in:
Adolfo Reyna
2023-02-06 14:43:05 -05:00
parent 6b8f9a56c5
commit f52b77f250
5 changed files with 66 additions and 25 deletions

View File

@@ -23,8 +23,10 @@ export default function App({ navigation, route }) {
<SafeAreaView style={styles.container}>
<LoginForm />
<StatusBar style="auto" />
<View style={{ position: "absolute", top: 30, left: 10, opacity: 0.5 }}>
<Text>{"<- Not an EMI family memeber?"}</Text>
<View style={{ position: "absolute", top: 60, left: 10, opacity: 0.5 }} >
<Text onPress={()=>{
alert("Register your church on fellowshipapps.com");
}}>{"<- Not an EMI family member?"}</Text>
</View>
</SafeAreaView>
);

View File

@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { View, TextInput, Image } from "react-native";
import { View, TextInput, Image, ScrollView } from "react-native";
import { Text, Button, Divider } from "react-native-paper";
import { SafeAreaView } from "react-native-safe-area-context";
import API from './../API.js';
@@ -102,6 +102,7 @@ let NewPostView = (props) => {
}
return (
<ScrollView>
<View style={{ padding: 10, paddingTop: 20, flex: 1, justifyContent: "center" }}>
<View style={{ flexDirection: "row", marginBottom: 10, justifyContent: "space-around" }}>
<Text style={{ fontSize: 25 }}>{i18n.t("message.statusUpdate")}:</Text>
@@ -151,6 +152,7 @@ let NewPostView = (props) => {
)
}
</View>
</ScrollView>
)
}

View File

@@ -10,7 +10,14 @@ let LoginForm = () => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [error, setError] = useState('');
const [tries, setTries] = useState(0);
const navigation = useNavigation();
const resetPasswordBol = tries > 2;
const resetPassword = async () => {
await API.resetPassword(email);
alert("We sent you instructions to your email!")
}
const loginCall = async () => {
let r = await API.logIn(email.trim(), password);
@@ -20,6 +27,16 @@ let LoginForm = () => {
});
//console.log(r)
setError(r.status);
if (r.status === 'incorrect password') {
if (resetPasswordBol) {
await resetPassword();
setTries(0);
} else {
setTries(tries + 1);
}
} else {
setTries(0);
}
//alert(i18n.t('message.wrongInformation'))
};
@@ -29,7 +46,7 @@ let LoginForm = () => {
style={styles.logo}
source={require('./../assets/icon.png')}
/>
<Text style={styles.header}>EMI Social</Text>
<Text style={styles.header}>EMI Fellowship</Text>
<Text >{i18n.t("message.login")}</Text>
<TextInput
style={styles.input}
@@ -41,6 +58,7 @@ let LoginForm = () => {
autoComplete='email'
autoCorrect={false}
mode="outlined"
keyboardType='email-address'
/>
{error !== '' && error !== 'incorrect password' ? <HelperText type="error" visible={true}>
{i18n.t("message.invalidEmail")}
@@ -61,12 +79,26 @@ let LoginForm = () => {
{error === 'incorrect password' ? <HelperText type="error" visible={true}>
{i18n.t("message.reviewPassword")}
</HelperText> : <></>}
<View style={{ flexDirection: "row" }}>
<Button
style={styles.button}
onPress={async () => {
await loginCall();
}}
>{i18n.t("message.submit")}</Button>
>
{resetPasswordBol ? i18n.t("message.resetPassword") : i18n.t("message.submit")}
</Button>
{
resetPasswordBol ? <Button
style={styles.button}
onPress={async () => {
setTries(0);
}}
>
{i18n.t("message.cancel")}
</Button> : <></>
}
</View>
</View>
);
}

View File

@@ -24,11 +24,12 @@ const VideoPlayer = ({ videosFiles, postId, profileId, poster, videoUrl, videoSt
setChosenVideo(chosenVideo);
}, [videoUrl, postId]);
const onLoad = ()=>{
const onLoad = async ()=>{
if(!viewer.data[postId]) return 0;
console.log(postId + " loaded")
video.current.setPositionAsync(viewer.data[postId].time*1000);
video.current.presentFullscreenPlayer();
await video.current.setPositionAsync(viewer.data[postId].time*1000);
//video.current.isPlaying = true;
//video.current.presentFullscreenPlayer();
};
//console.log("status", status)
@@ -56,7 +57,7 @@ const VideoPlayer = ({ videosFiles, postId, profileId, poster, videoUrl, videoSt
source={{
uri: chosenVideo.length ? chosenVideo[chosenVideo.length-1].link : '',
}}
useNativeControls={false}
useNativeControls={true}
shouldPlay={true}
resizeMode="contain"
onPlaybackStatusUpdate={status => setStatus(() => status)}

View File

@@ -33,8 +33,10 @@ const messages = {
loading: "Loading",
login: 'Login',
email: "Email",
cancel: "Cancel",
password: "Password",
rpassword: "Repeat Password",
resetPassword: "Reset password",
register: "Register",
name: "Nombre",
lastName: "Last Name",
@@ -65,7 +67,7 @@ const messages = {
IKnowThisPerson: "I know this person",
update: "Update",
invalidEmail: "Email address is invalid!",
reviewPassword: "Please review your passwrod.",
reviewPassword: "Please review your password.",
updatePhoto: "Update Photo",
optional: "Optional",
birthday: "Birthday",
@@ -103,8 +105,10 @@ const messages = {
loading: "Cargando",
login: 'Inicia Sesión',
email: "Correo Electronico",
cancel: "Cancelar",
password: "Contraseña",
rpassword: "Confirma tu Contraseña",
resetPassword: "Recuperar Contraseña",
register: "Registrate",
name: 'Nombre',
lastName: "Apeido",