#react-native #performance #email #react-navigation
Вопрос:
import { useRef, useState} from 'react'; import { StyleSheet, TouchableHighlight, Dimensions, Text, View, TouchableOpacity, SafeAreaView, Image, Button, TouchableWithoutFeedback, ScrollView, TextInput, Animated, Linking, } from 'react-native'; import { createStackNavigator, createAppContainer } from 'react-navigation'; import TacoTruckBG from './tacobg.png'; import TacoTruck from './tti.png'; import React from 'react'; import AntDesign from 'react-native-vector-icons/AntDesign'; import colors from './assets/colors/colors'; import emailjs from 'emailjs-com';
Проблема, с которой я сталкиваюсь, заключается в том, что при вводе учетных данных для имени пользователя, пароля и подтверждения пароля я ничего не получаю по электронной почте? но ИДК, почему?
вот ссылка на видео на YouTube, за которым я пытался следить:https://youtu.be/NgWGllOjkbs
const { width, height } = Dimensions.get('window');
const SignPage = ({ navigation }) => {
const buttonAnimation = useRef(new Animated.Value(0)).current;
const [username, setUsername] = useState(''); const [password,
setPassword] = useState(''); const [confirmpassword,
setConfirmPassword] = useState('');
const animateButton = () => {
Animated.timing(buttonAnimation, {
toValue: 1,
duration: 1550,
useNativeDriver: true,
}).start(() => navigation.navigate('Menu')); };
const buttonAnimationOpacity = {
opacity: buttonAnimation.interpolate({
inputRange: [0, 1],
outputRange: [1, 0]
}), };
function sendEmail(e) {
e.preventDefault();
emailjs.sendForm('gmail', 'template_22w29rt', e.target, 'user_LiXgplm1mPROridyDphPE')
.then((result) => {
console.log(result.text);
}, (error) => {
console.log(error.text);
});
e.target.reset(); }
return (
<View style={styles.container} onSubmit={sendEmail} >
<View style={styles.header}>
<Image source={TacoTruck} style={styles.logo} />
</View>
<View style={styles.footer}>
<Text style={styles.text_footer}>Username<AntDesign name="user" size={20} color={colors.cripsyWhite}
style={styles.cartIcon} /></Text>
<TextInput
name="username"
style={styles.textInput}
placeholder="Username"
autoCapitalize="none"
value={username}
onChangeText={(val) => setUsername(val)}
/>
<Text style={styles.text_footer}>Password<AntDesign name="lock" size={20} color={colors.cripsyWhite}
style={styles.cartIcon} /></Text><AntDesign name="lock" size={20}
color={colors.cripsyWhite} />
<TextInput
name="password"
style={styles.textInput}
placeholder="Password"
autoCapitalize="none"
secureTextEntry={true}
value={password}
onChangeText={(password) => setPassword(password)}
/>
<Text style={styles.text_footer}>Confirm Password<AntDesign name="lock" size={20} color={colors.cripsyWhite}
style={styles.cartIcon} /></Text>
<TextInput
name="confirmpassword"
style={styles.textInput}
placeholder="Confirm Password"
autoCapitalize="none"
secureTextEntry={true}
value={confirmpassword}
onChangeText={(confirmpassword) => setConfirmPassword(confirmpassword)}
/>
<View style={styles.action} >
<TouchableOpacity onPress={animateButton} onSubmit={sendEmail}>
<Animated.View style={[styles.box, buttonAnimationOpacity]}><AntDesign name="smileo" size={30}
color={colors.cripsyWhite} style={styles.smileIcon} /><Text
style={styles.text}>Confirm Account</Text></Animated.View>
</TouchableOpacity>
</View>
<Text style={styles.text_footer1} onPress={() => navigation.navigate('Login')}>Already have an account?</Text>
</View>
</View> ); }
export default SignPage;
Комментарии:
1. ваш вопрос очень плохо сформулирован.