فهرست منبع

regitsration2

vit9 5 سال پیش
والد
کامیت
a23ae11ef3
3فایلهای تغییر یافته به همراه105 افزوده شده و 2 حذف شده
  1. 31 2
      src/components/Auth/index.js
  2. 66 0
      src/components/Auth/registration.js
  3. 8 0
      src/reducer/index.js

+ 31 - 2
src/components/Auth/index.js

@@ -1,6 +1,7 @@
-import React, { Component } from "react";
+import React from "react";
 import { reduxForm, Field } from "redux-form";
 
+<<<<<<< HEAD
 import { renderField } from "../../common/formFunc";
 import  authValidate  from "../../utils/validate";
 
@@ -30,10 +31,38 @@ class Form extends Component  {
 				placeholder ="password" 
 				/>
 
+=======
+import { authValidate } from "../utils/validate";
+
+const Form = props => {
+	const { handleSubmit,submitting } = props
+		return (
+			<form className="auth__form" onSubmit={handleSubmit}>
+				<label>Login:</label>
+				<div>
+					<Field
+						 name="email"
+						 component="input"
+						 type="email" 
+						 label="E-mail:"
+						 placeholder="example@email.com"
+
+					/>
+				</div>
+				<label>Password:</label>
+				<div>	
+					<Field
+						 name="password"
+						 component="input" 
+						 type="password" 
+					 	 label="Password:" 
+						 placeholder ="password"  
+					/>
+				</div>
+>>>>>>> origin/Klishyn
 				<button className="auth__submit-button">Submit</button>
 			</form>
 		);
-	}
 }
 
 export default reduxForm({ form: "authForm", validate: authValidate })(Form);

+ 66 - 0
src/components/Auth/registration.js

@@ -0,0 +1,66 @@
+import React from 'react'
+import { Field, reduxForm } from 'redux-form'
+
+const RegistrForm = props => {
+  const { handleSubmit, pristine, reset, submitting } = props
+  return (
+    <form onSubmit={handleSubmit}>
+      <div>
+        <label>Login</label>
+        <div>
+          <Field
+            name="Login"
+            component="input"
+            type="text"
+            placeholder="Login"
+          />
+        </div>
+      </div>
+      <div>
+        <label>Name</label>
+        <div>
+          <Field
+            name="Name"
+            component="input"
+            type="text"
+            placeholder="Name"
+          />
+        </div>
+      </div>
+      <div>
+        <label>Phone</label>
+        <div>
+          <Field
+            name="Phone"
+            component="input"
+            type="text"
+            placeholder="+380XXXXXXXX"
+          />
+        </div>
+      </div>
+      <div>
+        <label>Email</label>
+        <div>
+          <Field
+            name="email"
+            component="input"
+            type="email"
+            placeholder="email@example.com"
+          />
+        </div>
+      </div>
+      <div>
+        <button type="submit" disabled={pristine || submitting}>
+          Submit
+        </button>
+        <button type="button" disabled={pristine || submitting} onClick={reset}>
+          Clear Values
+        </button>
+      </div>
+      </form>
+  )
+}
+
+export default reduxForm({
+  form: 'registrForm'
+})(RegistrForm)

+ 8 - 0
src/reducer/index.js

@@ -1,3 +1,4 @@
+<<<<<<< HEAD
 import { combineReducers } from "redux";
 import { reducer as formReducer } from 'redux-form';
 
@@ -6,4 +7,11 @@ import users from './users'
 export default  combineReducers({
     users: users,
     form: formReducer,
+=======
+import { combineReducers } from 'redux';
+import { reducer as formReducer } from 'redux-form';
+
+export default combineReducers({
+	form: formReducer,
+>>>>>>> origin/Klishyn
 })