Typos, iOS player and reset password
This commit is contained in:
@@ -23,8 +23,10 @@ export default function App({ navigation, route }) {
|
|||||||
<SafeAreaView style={styles.container}>
|
<SafeAreaView style={styles.container}>
|
||||||
<LoginForm />
|
<LoginForm />
|
||||||
<StatusBar style="auto" />
|
<StatusBar style="auto" />
|
||||||
<View style={{ position: "absolute", top: 30, left: 10, opacity: 0.5 }}>
|
<View style={{ position: "absolute", top: 60, left: 10, opacity: 0.5 }} >
|
||||||
<Text>{"<- Not an EMI family memeber?"}</Text>
|
<Text onPress={()=>{
|
||||||
|
alert("Register your church on fellowshipapps.com");
|
||||||
|
}}>{"<- Not an EMI family member?"}</Text>
|
||||||
</View>
|
</View>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
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 { Text, Button, Divider } from "react-native-paper";
|
||||||
import { SafeAreaView } from "react-native-safe-area-context";
|
import { SafeAreaView } from "react-native-safe-area-context";
|
||||||
import API from './../API.js';
|
import API from './../API.js';
|
||||||
@@ -102,6 +102,7 @@ let NewPostView = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<ScrollView>
|
||||||
<View style={{ padding: 10, paddingTop: 20, flex: 1, justifyContent: "center" }}>
|
<View style={{ padding: 10, paddingTop: 20, flex: 1, justifyContent: "center" }}>
|
||||||
<View style={{ flexDirection: "row", marginBottom: 10, justifyContent: "space-around" }}>
|
<View style={{ flexDirection: "row", marginBottom: 10, justifyContent: "space-around" }}>
|
||||||
<Text style={{ fontSize: 25 }}>{i18n.t("message.statusUpdate")}:</Text>
|
<Text style={{ fontSize: 25 }}>{i18n.t("message.statusUpdate")}:</Text>
|
||||||
@@ -151,6 +152,7 @@ let NewPostView = (props) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
|
</ScrollView>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,14 @@ let LoginForm = () => {
|
|||||||
const [email, setEmail] = useState('');
|
const [email, setEmail] = useState('');
|
||||||
const [password, setPassword] = useState('');
|
const [password, setPassword] = useState('');
|
||||||
const [error, setError] = useState('');
|
const [error, setError] = useState('');
|
||||||
|
const [tries, setTries] = useState(0);
|
||||||
const navigation = useNavigation();
|
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 () => {
|
const loginCall = async () => {
|
||||||
let r = await API.logIn(email.trim(), password);
|
let r = await API.logIn(email.trim(), password);
|
||||||
@@ -20,6 +27,16 @@ let LoginForm = () => {
|
|||||||
});
|
});
|
||||||
//console.log(r)
|
//console.log(r)
|
||||||
setError(r.status);
|
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'))
|
//alert(i18n.t('message.wrongInformation'))
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -29,7 +46,7 @@ let LoginForm = () => {
|
|||||||
style={styles.logo}
|
style={styles.logo}
|
||||||
source={require('./../assets/icon.png')}
|
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>
|
<Text >{i18n.t("message.login")}</Text>
|
||||||
<TextInput
|
<TextInput
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
@@ -41,6 +58,7 @@ let LoginForm = () => {
|
|||||||
autoComplete='email'
|
autoComplete='email'
|
||||||
autoCorrect={false}
|
autoCorrect={false}
|
||||||
mode="outlined"
|
mode="outlined"
|
||||||
|
keyboardType='email-address'
|
||||||
/>
|
/>
|
||||||
{error !== '' && error !== 'incorrect password' ? <HelperText type="error" visible={true}>
|
{error !== '' && error !== 'incorrect password' ? <HelperText type="error" visible={true}>
|
||||||
{i18n.t("message.invalidEmail")}
|
{i18n.t("message.invalidEmail")}
|
||||||
@@ -61,12 +79,26 @@ let LoginForm = () => {
|
|||||||
{error === 'incorrect password' ? <HelperText type="error" visible={true}>
|
{error === 'incorrect password' ? <HelperText type="error" visible={true}>
|
||||||
{i18n.t("message.reviewPassword")}
|
{i18n.t("message.reviewPassword")}
|
||||||
</HelperText> : <></>}
|
</HelperText> : <></>}
|
||||||
|
<View style={{ flexDirection: "row" }}>
|
||||||
<Button
|
<Button
|
||||||
style={styles.button}
|
style={styles.button}
|
||||||
onPress={async () => {
|
onPress={async () => {
|
||||||
await loginCall();
|
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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,11 +24,12 @@ const VideoPlayer = ({ videosFiles, postId, profileId, poster, videoUrl, videoSt
|
|||||||
setChosenVideo(chosenVideo);
|
setChosenVideo(chosenVideo);
|
||||||
}, [videoUrl, postId]);
|
}, [videoUrl, postId]);
|
||||||
|
|
||||||
const onLoad = ()=>{
|
const onLoad = async ()=>{
|
||||||
if(!viewer.data[postId]) return 0;
|
if(!viewer.data[postId]) return 0;
|
||||||
console.log(postId + " loaded")
|
console.log(postId + " loaded")
|
||||||
video.current.setPositionAsync(viewer.data[postId].time*1000);
|
await video.current.setPositionAsync(viewer.data[postId].time*1000);
|
||||||
video.current.presentFullscreenPlayer();
|
//video.current.isPlaying = true;
|
||||||
|
//video.current.presentFullscreenPlayer();
|
||||||
};
|
};
|
||||||
|
|
||||||
//console.log("status", status)
|
//console.log("status", status)
|
||||||
@@ -56,7 +57,7 @@ const VideoPlayer = ({ videosFiles, postId, profileId, poster, videoUrl, videoSt
|
|||||||
source={{
|
source={{
|
||||||
uri: chosenVideo.length ? chosenVideo[chosenVideo.length-1].link : '',
|
uri: chosenVideo.length ? chosenVideo[chosenVideo.length-1].link : '',
|
||||||
}}
|
}}
|
||||||
useNativeControls={false}
|
useNativeControls={true}
|
||||||
shouldPlay={true}
|
shouldPlay={true}
|
||||||
resizeMode="contain"
|
resizeMode="contain"
|
||||||
onPlaybackStatusUpdate={status => setStatus(() => status)}
|
onPlaybackStatusUpdate={status => setStatus(() => status)}
|
||||||
|
|||||||
@@ -33,8 +33,10 @@ const messages = {
|
|||||||
loading: "Loading",
|
loading: "Loading",
|
||||||
login: 'Login',
|
login: 'Login',
|
||||||
email: "Email",
|
email: "Email",
|
||||||
|
cancel: "Cancel",
|
||||||
password: "Password",
|
password: "Password",
|
||||||
rpassword: "Repeat Password",
|
rpassword: "Repeat Password",
|
||||||
|
resetPassword: "Reset password",
|
||||||
register: "Register",
|
register: "Register",
|
||||||
name: "Nombre",
|
name: "Nombre",
|
||||||
lastName: "Last Name",
|
lastName: "Last Name",
|
||||||
@@ -65,7 +67,7 @@ const messages = {
|
|||||||
IKnowThisPerson: "I know this person",
|
IKnowThisPerson: "I know this person",
|
||||||
update: "Update",
|
update: "Update",
|
||||||
invalidEmail: "Email address is invalid!",
|
invalidEmail: "Email address is invalid!",
|
||||||
reviewPassword: "Please review your passwrod.",
|
reviewPassword: "Please review your password.",
|
||||||
updatePhoto: "Update Photo",
|
updatePhoto: "Update Photo",
|
||||||
optional: "Optional",
|
optional: "Optional",
|
||||||
birthday: "Birthday",
|
birthday: "Birthday",
|
||||||
@@ -103,8 +105,10 @@ const messages = {
|
|||||||
loading: "Cargando",
|
loading: "Cargando",
|
||||||
login: 'Inicia Sesión',
|
login: 'Inicia Sesión',
|
||||||
email: "Correo Electronico",
|
email: "Correo Electronico",
|
||||||
|
cancel: "Cancelar",
|
||||||
password: "Contraseña",
|
password: "Contraseña",
|
||||||
rpassword: "Confirma tu Contraseña",
|
rpassword: "Confirma tu Contraseña",
|
||||||
|
resetPassword: "Recuperar Contraseña",
|
||||||
register: "Registrate",
|
register: "Registrate",
|
||||||
name: 'Nombre',
|
name: 'Nombre',
|
||||||
lastName: "Apeido",
|
lastName: "Apeido",
|
||||||
|
|||||||
Reference in New Issue
Block a user