-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Closed
Closed
Copy link
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
import React, { Component } from 'react';
import { NativeModules } from 'react-native';
import DatePicker from 'react-native-datepicker'
import ValidationComponent, {validate} from 'react-native-form-validator';
import { Text, TextInput, View, Button, Form, NativeAppEventEmitter, Camera, Alert } from 'react-native';
export default class Registration extends Component {
constructor(props) {
super(props);
this.state = {text: '', date:""};
}
_onPressButton() {
// Call ValidationComponent validate method
validate({
Username: {minlength:3, maxlength:7, required: true},
email: {email: true},
lastName: {required: true},
});
}
render() {
return (
<View style={{padding: 30}}>
<TextInput
Name="firstName"
style={{height: 40}}
autoFocus={true}
autoCapitalize="none"
autoCorrect={false}
placeholder="First Name"
onChangeText={(firstName) => this.setState({firstName})}
/>
<TextInput
Name="lastName"
style={{height: 40}}
autoFocus={false}
autoCapitalize="none"
autoCorrect={false}
placeholder="Last Name"
onChangeText={(lastName) => this.setState({lastName})}
/>
<DatePicker
style={{width: 800}}
date={this.state.date}
mode="date"
placeholder="Select Date of Birth"
format="YYYY-MM-DD"
confirmBtnText="Confirm"
cancelBtnText="Cancel"
customStyles={{
dateIcon: {
position: 'absolute',
left: 0,
top: 4,
marginLeft: 0
},
dateInput: {
marginLeft: 36
}
// ... You can check the source to find the other keys.
}}
onDateChange={(date) => {this.setState({date: date})}}
/>
<TextInput
Name="email"
style={{height: 40}}
autoFocus={false}
autoCapitalize="none"
autoCorrect={false}
placeholder="Email"
onChangeText={(email) => this.setState({email})}
/>
<TextInput
Name="Username"
style={{height: 40}}
placeholder="Username!"
onChangeText={(text) => this.setState({text})}
/>
<TextInput
Name="password"
style={{height: 40}}
placeholder="password!"
secureTextEntry={true}
autoCapitalize="none"
autoCorrect={false}
onChangeText={(text) => this.setState({text})}
/>
<TextInput
Name="passwordConfirmation"
style={{height: 40}}
secureTextEntry={true}
autoCapitalize="none"
autoCorrect={false}
placeholder="Password Confirmation"
onChangeText={(passwordConfirmation) => this.setState({passwordConfirmation})}
/>
<Button
onPress={this._onPressButton}
title="Press Me"
/>
);
}
}
Metadata
Metadata
Assignees
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.