Progress on i18n
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { StatusBar } from 'expo-status-bar';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import { Text, View, StyleSheet, Image } from 'react-native';
|
||||
import { TextInput, Button } from 'react-native-paper';
|
||||
import API from './../API.js';
|
||||
import { useNavigation } from '@react-navigation/native';
|
||||
import GlobalState from '../contexts/GlobalState.js';
|
||||
import i18n from "../i18nMessages.js";
|
||||
|
||||
|
||||
let LoginForm = () => {
|
||||
@@ -13,12 +12,12 @@ let LoginForm = () => {
|
||||
const navigation = useNavigation();
|
||||
|
||||
const loginCall = async ()=>{
|
||||
let r = await API.logIn(email, password);
|
||||
let r = await API.logIn(email.trim(), password);
|
||||
if (r.status === "ok") return navigation.reset({
|
||||
index: 0,
|
||||
routes: [{ name: 'MainNavigation' }],
|
||||
});
|
||||
alert('Please review the information')
|
||||
alert(i18n.t('message.wrongInformation'))
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -28,13 +27,13 @@ let LoginForm = () => {
|
||||
source={require('./../assets/icon.png')}
|
||||
/>
|
||||
<Text style={styles.header}>EMI Social</Text>
|
||||
<Text >Login</Text>
|
||||
<Text >{i18n.t("message.login")}</Text>
|
||||
<TextInput
|
||||
style={styles.input}
|
||||
onChangeText={text => setEmail(text)}
|
||||
defaultValue={email}
|
||||
placeholder="email"
|
||||
label="email:"
|
||||
label={i18n.t("message.email")}
|
||||
autoCapitalize='none'
|
||||
autoComplete='email'
|
||||
autoCorrect={false}
|
||||
@@ -46,7 +45,7 @@ let LoginForm = () => {
|
||||
defaultValue={password}
|
||||
placeholder="password"
|
||||
textContentType="password"
|
||||
label="password:"
|
||||
label={i18n.t("message.password")}
|
||||
secureTextEntry={true}
|
||||
autoCapitalize='none'
|
||||
autoComplete='email'
|
||||
@@ -58,7 +57,7 @@ let LoginForm = () => {
|
||||
onPress={async () => {
|
||||
await loginCall();
|
||||
}}
|
||||
>submit</Button>
|
||||
>{i18n.t("message.submit")}</Button>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user