{"size": 2079, "ext": "js", "max_stars_repo_path": "src/Pages/Tform.js", "max_stars_repo_name": "sr1jan/womenSafetyApp", "max_stars_repo_stars_event_min_datetime": "2019-10-01T17:32:54.000Z", "max_stars_repo_stars_event_max_datetime": "2020-02-27T10:53:03.000Z", "max_issues_repo_path": "src/Pages/Tform.js", "max_issues_repo_name": "sr1jan/womenSafetyApp", "max_issues_repo_issues_event_min_datetime": "2019-09-30T09:54:43.000Z", "max_issues_repo_issues_event_max_datetime": "2019-10-02T09:10:35.000Z", "max_forks_repo_path": "src/Pages/Tform.js", "max_forks_repo_name": "sr1jan/womenSafetyApp", "max_forks_repo_forks_event_min_datetime": "2021-02-11T15:02:17.000Z", "max_forks_repo_forks_event_max_datetime": "2021-02-11T15:02:17.000Z"}
{"max_stars_count": 3, "max_issues_count": 3, "max_forks_count": 1, "avg_line_length": 24.1744186047, "max_line_length": 93, "alphanum_fraction": 0.6402116402}
import React, { Component } from 'react';
import { Text, View, StyleSheet, StatusBar, TextInput, TouchableOpacity} from 'react-native';
import firebase from 'react-native-firebase'
import {Actions} from 'react-native-router-flux';

export default class Tform extends Component {

	call2(){
		Actions.ssform()
	}

	state = { email: '', password: '', errorMessage: null }

	handleSignUp = () => {
		if (this.state.email=='' || this.state.password=='') { 
			alert("SignUp or Password can not be empty")
		} else {
			firebase
			.auth()
			.createUserWithEmailAndPassword(this.state.email, this.state.password)
			.then(() => this.call2())
			.catch(error => this.setState({ errorMessage: error.message }))
		}
	}

	render() {
		return(
			<View style={styles.container}>
				{this.state.errorMessage &&
					<Text style={{ color: 'red' }}>
					{this.state.errorMessage}
					</Text>
				}
				<TextInput style={styles.inputBox}
				  placeholder="Email"
				  placeholderTextColor = "#ffffff"
				  onChangeText={email => this.setState({ email })}
				  value={this.state.email}
				/>
				<TextInput
				  secureTextEntry
				  style={styles.inputBox}
				  placeholder="Password"
				  secureTextEntry={true}
				  placeholderTextColor = "#ffffff"
				  onChangeText={password => this.setState({ password })}
                  value={this.state.password}
				/>
				<TouchableOpacity style={styles.button} onPress={this.handleSignUp}>
				  <Text style={styles.buttonText}>SignUp</Text>
				</TouchableOpacity>
	
        	</View>

		);
	}
}

const styles = StyleSheet.create({
	container: {
		backgroundColor: '#3d5afe',
		alignItems :'center',
		justifyContent : 'center',
	},
	inputBox: {
		width: 300,
		backgroundColor: 'rgba(255, 255, 255, 0.3)',
		borderRadius: 25,
		paddingHorizontal: 16,
		fontSize: 16,
		color: '#ffffff',
		marginVertical: 10,
	},
	button:{
		width: 150,
		backgroundColor: 'rgba(255, 255, 255, 0.1)',
		borderRadius: 15,
		marginVertical: 10,
		paddingVertical: 10
	},
	buttonText: {
		fontSize: 16,
		textAlign: 'center',
		color: '#ffffff'
	}
});