Почему то не хочет принимать задачу, хотя код работает. и вывод после нажатия 2 текста
import React, { useState } from "react";
import {
ActivityIndicator,
Dimensions,
StyleSheet,
Text,
TextInput,
TouchableOpacity,
View,
} from "react-native";
const { width } = Dimensions.get("window");
export default function App() {
const [email, setEmail] = useState("");
const [pass, setPass] = useState("");
const [showName, setShowName] = useState(true);
return (
<>
{showName ? (
<View style={styles.container}>
<Text style={styles.header}>Sign In</Text>
<TextInput
value={email}
onChangeText={(text) => setEmail(text)}
style={styles.input}
placeholder="Enter email"
placeholderTextColor="#254441"
/>
<TextInput
value={pass}
secureTextEntry
onChangeText={(text) => setPass(text)}
style={styles.input}
placeholder="Enter password"
placeholderTextColor="#254441"
/>
<TouchableOpacity
onPress={() => setShowName(false)}
activeOpacity={0.75}
style={styles.button}
>
<Text
style={{
fontWeight: "bold",
fontSize: 20,
}}
>
Login
</Text>
</TouchableOpacity>
</View>
) : (
<>
<Text style={styles.header}>Hello</Text>
<Text style={styles.header}>{email}</Text>
</>
)}
</>
);
}
const styles = StyleSheet.create({
button: {
height: 60,
marginTop: 20,
padding: 10,
width: 0.8 * width,
backgroundColor: "#43AA8B",
display: "flex",
alignItems: "center",
justifyContent: "center",
borderRadius: 10,
},
input: {
color: "#254441",
width: 0.8 * width,
height: 60,
backgroundColor: "#ffffff",
fontSize: 20,
borderRadius: 10,
marginTop: 20,
padding: 10,
},
container: {
flex: 1,
backgroundColor: "#FF6F59",
alignItems: "center",
justifyContent: "center",
},
header: {
color: "#254441",
fontWeight: "bold",
fontSize: 26,
},
});