Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save virtualdesigner/cbec01376046d355d4e7383538ea16bb to your computer and use it in GitHub Desktop.
Save virtualdesigner/cbec01376046d355d4e7383538ea16bb to your computer and use it in GitHub Desktop.
<View style={{ flex: 1 }}>
<View style={styles.logocontainer}>
<View style={styles.logoimage}>
<Image
source={require("./images/logonew.png")}
style={{ height: "100%", width: "100%" }}
resizeMethod="resize"
resizeMode="contain"
/>
</View>
</View>
<KeyboardAvoidingView
style={styles.container}
behavior={"position"}
keyboardVerticalOffset={keyboardVerticalOffset}
>
<View style={styles.formcontainer}>
<View style={styles.titlecontainer}>
<Image
source={require("./images/login1.png")}
style={{
height: "100%",
width: "100%"
}}
resizeMethod={"resize"}
resizeMode={"contain"}
/>
</View>
<View>
<TextInput
autoCapitalize="none"
placeholder="Email"
placeholderTextColor="#dcdde1"
underlineColorAndroid="transparent"
returnKeyType="next"
onSubmitEditing={() => {
this.passwordinput.focus();
}}
style={styles.input1}
value={this.state.email}
onBlur={() => {
if (
String(this.state.email) !== "" &&
String(this.state.email) !== "undefined"
) {
this.setState((prevState, prevProps) => {
let modifiedEmail = String(prevState.email)
.toLowerCase()
.replace(/[\r|\n|\s]/g, "");
return {
email: modifiedEmail
};
});
}
}}
onChangeText={e => this.setState({ email: e })}
/>
<TextInput
autoCapitalize="none"
placeholder="Password"
placeholderTextColor="#dcdde1"
underlineColorAndroid="transparent"
secureTextEntry
returnKeyType="done"
ref={input => {
this.passwordinput = input;
}}
style={styles.input2}
onChangeText={e => this.setState({ password: e })}
/>
{this.state.loginButton ? (
<TouchableOpacity disabled={true} style={styles.loadingbutton}>
<ActivityIndicator size="small" color="#000000" />
</TouchableOpacity>
) : (
<TouchableOpacity
disabled={this.state.loginButton}
style={styles.buttoncontainer}
onPress={() => this.login(email, password)}
>
<Text style={styles.buttonText}>I'm Back!!</Text>
</TouchableOpacity>
)}
</View>
</View>
<View>
<View style={styles.signuplinkcontainer}>
<View
style={{
flex: 1,
justifyContent: "space-between",
flexDirection: "row"
}}
>
<TouchableOpacity
onPress={() => {
this.props.setUser("forgotpassword");
}}
style={{ paddingLeft: 5, paddingRight: 5 }}
>
<Text style={styles.signuptext}>Forgot password?</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
this.props.setUser("signup");
}}
style={{ paddingLeft: 5, paddingRight: 5 }}
>
<Text
style={{
...styles.signuptext
}}
>
Sign Up
</Text>
</TouchableOpacity>
</View>
</View>
</View>
</KeyboardAvoidingView>
</View>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment