Skip to content

Instantly share code, notes, and snippets.

@janhesters
Last active October 4, 2018 09:07
Show Gist options
  • Save janhesters/ca6bcea85c0a605a99b2d1863a0ed899 to your computer and use it in GitHub Desktop.
Save janhesters/ca6bcea85c0a605a99b2d1863a0ed899 to your computer and use it in GitHub Desktop.
import strings from "./strings";
import styles from "./styles";
import { strings as loginStrings } from "../../screens/Login";
import React, { Component } from "react";
import { View } from "react-native";
import { Button, Input } from "react-native-elements";
import { NavigationScreenProp } from "react-navigation";
interface Props {
navigation: NavigationScreenProp<any, any>
}
export default class LoginForm extends Component<Props, object> {
renderForm = () => (
<View style={styles.container}>
<Input
placeholder={strings.emailAddress}
keyboardType="email-address"
autoCapitalize="none"
/>
<Input placeholder={strings.password} secureTextEntry autoCapitalize="none" />
<Button
clear
title={loginStrings.forgottenPassword}
containerStyle={styles.forgottenPasswordButtonContainer}
titleStyle={styles.forgottenPasswordTitle}
onPress={() => this.props.navigation.navigate("PasswordResetScreen")}
/>
<Button
title={loginStrings.loginTitle}
containerStyle={styles.loginButtonContainer}
buttonStyle={styles.loginButton}
disabledStyle={styles.disabled}
titleStyle={styles.loginButtonTitle}
disabledTitleStyle={styles.loginButtonTitle}
/>
</View>
);
render() {
return this.renderForm();
}
}
export default LoginForm;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment