<commit_before>import React from 'react'
import { connect } from 'react-redux'
import { postNewUser } from '../reducers/user.jsx'
import { login } from '../reducers/auth.jsx'
import { Row, Col } from 'react-bootstrap'

const SignupLogin = (props) => {

	console.log(props)

	const submitSignUp = (event) => {
		console.log('sign up firing')
		event.preventDefault()
		const firstName = event.target.firstName.value,
			lastName = event.target.lastName.value,
			email = event.target.email.value,
			address = event.target.address.value,
			password = event.target.password.value
		const newUser = { firstName, lastName, email, address, password }
		props.addUser(newUser)
	}

	const submitLogin = (event) => {
		console.log('login firing')
		event.preventDefault()
		const username = event.target.username.value,
			password = event.target.password.value
		login(username,password)
	}

	return (
		<Col md={12}>
			<h1> Sign Up </h1>
			<form onSubmit={submitSignUp}>
				<input name="firstName" placeholder='First Name'/> <br/>
				<input name="lastName" placeholder= "Last Name"/> <br/>
				<input name="email" placeholder="Email"/> <br/>
				<input name="address" placeholder="Address"/> <br/> 
				<input name="password" placeholder="Password" type="password"/><br/>
				<input type="submit" value="SignUp" /><br/>
			</form>

			<h1> Login </h1>
			<form
				onSubmit={submitLogin}>
				<input name="username" placeholder="Username" /><br/>
				<input name="password" placeholder="Password" type="password"/><br/>
				<input type="submit" value="login" /><br/>
			</form>
		</Col>
	)
}

const mapThunksToProps = dispatch => ({
	addUser: (newUser) => dispatch(postNewUser(newUser)),
	login: (username, password) => dispatch(login(username, password))
})

export default connect(null,mapThunksToProps)(SignupLogin)<commit_msg>fixed auth<commit_after>import React from 'react'
import { connect } from 'react-redux'
import { postNewUser } from '../reducers/user.jsx'
import { login } from '../reducers/auth.jsx'
import { Row, Col } from 'react-bootstrap'

const SignupLogin = (props) => {

	console.log(props)

	const submitSignUp = (event) => {
		console.log('sign up firing')
		event.preventDefault()
		const firstName = event.target.firstName.value,
			lastName = event.target.lastName.value,
			email = event.target.email.value,
			address = event.target.address.value,
			password = event.target.password.value
		const newUser = { firstName, lastName, email, address, password }
		props.addUser(newUser)
	}

	const submitLogin = (event) => {
		console.log('login firing')
		event.preventDefault()
		const username = event.target.username.value,
			password = event.target.password.value
		props.login(username,password)
	}

	return (
		<Col md={12}>
			<h1> Sign Up </h1>
			<form onSubmit={submitSignUp}>
				<input name="firstName" placeholder='First Name'/> <br/>
				<input name="lastName" placeholder= "Last Name"/> <br/>
				<input name="email" placeholder="Email"/> <br/>
				<input name="address" placeholder="Address"/> <br/>
				<input name="password" placeholder="Password" type="password"/><br/>
				<input type="submit" value="SignUp" /><br/>
			</form>

			<h1> Login </h1>
			<form
				onSubmit={submitLogin}>
				<input name="username" placeholder="Username" /><br/>
				<input name="password" placeholder="Password" type="password"/><br/>
				<input type="submit" value="login" /><br/>
			</form>
		</Col>
	)
}

const mapThunksToProps = dispatch => ({
	addUser: (newUser) => dispatch(postNewUser(newUser)),
	login: (username, password) => dispatch(login(username, password))
})

export default connect(null,mapThunksToProps)(SignupLogin)
{'fraction_non_alphanumeric': 0.16584699453551913, 'fraction_numerical': 0.003278688524590164, 'mean_word_length': 4.290462427745664, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5604335', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1153, 'n_words': 266}