const Practice27 = (props) => {
const [text, setText] = useState("");
const [textp, setTextp] = useState("");
return (
<View style={styles.container}>
<View style={styles.inputView}>
<TextInput
placeholder="Username..."
value={text}
keyboardType="email-address"
style={styles.inputText}
onChangeText={(text) => {
setText(text);
username = text;
}}
></TextInput>
</View>
<View style={styles.inputView}>
<TextInput
placeholder="Password..."
style={styles.inputText}
secureTextEntry={true}
value={textp}
onChangeText={(textp) => {
setTextp(textp);
password = textp;
}}
></TextInput>
</View>
<View style={styles.loginBtn}> //using a view tag here
<TouchableOpacity onPress={login}>
<Text style={styles.loginText}>LOGIN</Text>
</TouchableOpacity>
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#003f5c",
alignItems: "center",
justifyContent: "center",
},
loginBtn: {
backgroundColor: "#33eacd",
height: 50,
justifyContent: "center",//you using alignitem center Thats why i remove this
padding: 10,
borderRadius: 25,
width: "80%",
},
loginText: {
color: "white",
},
inputView: {
width: "80%",
backgroundColor: "#465881",
borderRadius: 25,
height: 50,
marginBottom: 20,
padding: 20,
},
inputText: {
height: 50,
justifyContent: "center",
textAlign:"center"
color: "white",
},
});
export default Practice27;