4 Commitit a75d07fe91 ... 1632b2cf17

Tekijä SHA1 Viesti Päivämäärä
  vit9 1632b2cf17 l 5 vuotta sitten
  vit9 e7972b07d6 Merge branch 'Alesha1' into dev 5 vuotta sitten
  vit9 4285bf9ac4 m 5 vuotta sitten
  Vlad 9b12d7c227 vlad 5 vuotta sitten
34 muutettua tiedostoa jossa 524 lisäystä ja 203 poistoa
  1. 5 0
      src/actions/usersAuthActions.js
  2. 5 0
      src/actions/usersRegistrActions.js
  3. 1 1
      src/common/authRenderField.js
  4. 98 29
      src/components/AllStaffs/FullInfoAboutStaff.js
  5. 27 30
      src/components/AllStaffs/index.js
  6. 3 3
      src/components/Auth/authButtons.js
  7. 1 1
      src/components/Auth/authorisation.js
  8. 7 9
      src/components/Auth/registration.js
  9. 17 20
      src/components/FormsAdd/FormAddNewStaff/SendingStaffForm.js
  10. 34 21
      src/components/FormsAdd/redForm/index.js
  11. 15 0
      src/components/Modal/addNewStaffModal.js
  12. 4 3
      src/components/Modal/index.js
  13. 1 1
      src/components/SearchStaffsPage/index.js
  14. 4 3
      src/container/AddNewStaff.js
  15. 7 3
      src/container/CategoryStaffInfo.js
  16. 2 2
      src/container/MainPageStaffInfo.js
  17. 19 16
      src/container/SearchStaff.js
  18. 7 5
      src/container/SearchStaffsInfo.js
  19. 27 22
      src/container/UserProfile.js
  20. 1 1
      src/container/activeStaffs.js
  21. 20 6
      src/container/redactorForm.js
  22. 21 4
      src/container/renderAuthorisation.js
  23. 19 4
      src/container/renderRegistration.js
  24. 2 1
      src/reducer/addStaff.js
  25. 11 2
      src/reducer/usersAuthorisation.js
  26. 11 2
      src/reducer/usersRegistration.js
  27. 0 1
      src/router.js
  28. 1 1
      src/style/base/_base.scss
  29. 126 0
      src/style/components/_allStaff.scss
  30. 9 6
      src/style/components/_form.scss
  31. 0 2
      src/style/components/_formLogin.scss
  32. 14 0
      src/style/components/_userProfil.scss
  33. 4 3
      src/style/index.scss
  34. 1 1
      src/utils/authValidate.js

+ 5 - 0
src/actions/usersAuthActions.js

@@ -2,6 +2,11 @@ import * as types from "../constants/actionTypes";
 
 const axios = require("axios");
 
+export const closeModal = payload => ({
+    type: types.CLOSE_MODAL_WINDOW,
+    payload
+})
+
 const userAuthRequest = payload => ({
     type: types.USER_AUTH_REQUEST,
     payload

+ 5 - 0
src/actions/usersRegistrActions.js

@@ -2,6 +2,11 @@ import * as types from "../constants/actionTypes";
 
 const axios = require("axios");
 
+export const closeModal = payload => ({
+    type: types.CLOSE_MODAL_WINDOW,
+    payload
+})
+
 const userRegRequest = payload => ({
     type: types.USER_REG_REQUEST,
     payload

+ 1 - 1
src/common/authRenderField.js

@@ -2,7 +2,7 @@ import React from "react";
 
 export const authRenderField = ({input, meta: {touched, error}, label, type, placeholder }) => (
     <div className={touched && error ? "form__input-box":"error"}> 
-        {console.log(input.value)} 
+        {console.log(error)} 
         <label className="form__input-label" htmlFor="origin">
             {label}
             <input  className="input" type = {type} placeholder = {placeholder} {...input} />

+ 98 - 29
src/components/AllStaffs/FullInfoAboutStaff.js

@@ -1,13 +1,61 @@
 import React, { Component, Fragment } from 'react';
 
-import Loader from 'react-loader-spinner'
+import Loader from 'react-loader-spinner';
+import { Menu, Icon, Carousel } from 'antd';
 
 class FullInfoAboutStaff extends Component {
-    
+    constructor(props) {
+        super(props)
+        
+        this.state = {
+            count: 0,
+        }
+    }
+
+    // nextCount = () => {
+    //     // console.log(this.arr)
+    //     // console.log(this.arr.length)
+
+    //     if (this.state.count == this.arr.length - 1) {
+    //         this.setState({ count: 0 })
+    //         console.log("sdgdfg")
+    //     }
+    //     else {
+    //         this.setState({ count: this.state.count + 1 })
+    //     }
+
+    // }
+
+    // backCount = () => {
+    //     if (this.state.count === 0) {
+    //         this.setState({ count: this.arr.length - 1 })
+    //     }
+    //     else {
+    //         this.setState({ count: this.state.count - 1 })
+    //     }
+
+    // }
+
+    // componentDidMount(){
+    //     const { InfoStaff } = this.props
+    //     let str;
+
+    //     str = InfoStaff.map(el => {
+    //         console.log(el.img)
+    //         let str1 = el.img.substr(29)
+    //         for (var i = 0, b = 24; i < str1.length; i = i + 25) {
+
+    //             this.arr.push(str1.substr(i, b))
+    //         }
+
+    //     })
+    // }
+
     render() {
+        console.log(this.arr)
         const { InfoStaff, isFetching } = this.props
-         let arr = [];
-         let str;
+        let arr = [];
+        let str;
         // let str1
         // let str2
         // str = InfoStaff.map(el=> el.img.substr(0,29));
@@ -19,10 +67,9 @@ class FullInfoAboutStaff extends Component {
 
 
 
-
-
         str = InfoStaff.map(el => {
-            console.log(el.img)
+            console.log(el.state)
+
              if(el.state){
                 let str1  = el.img.substr(29)  
            
@@ -42,34 +89,56 @@ class FullInfoAboutStaff extends Component {
         let data;
             if(isFetching===true){
                 data = <div className="loader"> 
+
                 <Loader type="Triangle"
                     color="#FD7F71"
-                    height="100"	
+                    height="100"
                     width="100"
-                /> 
-            </div> 
-            }
-            else {
-                data = InfoStaff.map((el,key)=>(
-                    <div className="staff" key={key}>
-                        {el.title} {el.price} {el.description}  
-                    </div>)
-                )
-                data1 =  arr.map(el => 
-                    <div>
-                    {
-                    el.state ?  <img src={`http://127.0.0.1:2000/static/${el.newStr}`} width="325" height="190" className="imgStaff"  alt="lorem" />
-                : <img src={`${el.defaultStr}`} width="325" height="190" className="imgStaff"  alt="lorem" /> 
-                    }</div>)
-            }
+
+                />
+            </div>
+        }
+        else {
+            data = InfoStaff.map((el, key) => (
+
+                <div>
+                    {/* <img src={str+str1} width="325" height="190" className="imgStaff"  alt="lorem" />
+                    <img src={str+str2} width="325" height="190" className="imgStaff"  alt="lorem" /> */}
+
+                    {el.title} {el.price} {el.description}
+                </div>)
+
+            )
+            data1 = <div className="carusel">
+                    <Carousel effect="fade">
+                        {arr.map(el => <div>
+                            {el.state ? <img src={`http://127.0.0.1:2000/static/${el.newStr}`} className="fullImgStaff" alt="lorem" /> : 
+                            <img src={`${el.defaultStr}`} width="325" height="190" className="imgStaff"  alt="lorem" />}
+                        </div>)}   
+                    </Carousel>
+                </div>
+            
+            // arr.map(el => <div><img src={`http://127.0.0.1:2000/static/${el}`} className="fullImgStaff" alt="lorem" /></div>)
+            // data1 = arr.map(el => console.log() )
+        }
+
+
         return (
 
-            <Fragment>
-                
-             {data} 
-            {data1}      
-            </Fragment>
+            <div className="staffinfo" >
+
+                {/* <div class="carusel">
+                    <div class="back but" onClick={this.backCount} ><Icon type="left" /></div>
+                    <div class="el-carusel">
+                        <img src={`http://127.0.0.1:2000/static/${this.arr[this.state.count]}`} width="325" height="190" className="fullImgStaff" alt="lorem" />
+                    </div>
+                    <div class="next but" onClick={this.nextCount} ><Icon type="left" /></div>
+                </div> */}
+
+                {data1}
 
+                {data}
+            </div>
         );
         }
 }

+ 27 - 30
src/components/AllStaffs/index.js

@@ -5,43 +5,40 @@ import Loader from 'react-loader-spinner';
 import AddNewStaff from '../../components/BtnAddNewStaff'
 
 class AllStaffs extends Component {
-    
+
     render() {
         const { inputStaffs, isFetching, isAdmin, getUser } = this.props
         let data;
-        console.log(this.props)
-            if(isFetching===true){            
-
-                data = <div className="loader"> 
-                    <Loader type="Triangle"
-                        color="#FD7F71"
-                        height="100"	
-                        width="100"
-                    /> 
-                </div> 
-            } else {
-                data = <div className="staffs">
-                    {inputStaffs.map((el,key)=>(
-                        <Link to={`/staff/${el.id}`} key={key}>
-                            <div className="staff">
-                             {el.state ?  <img src={el.img.substr(0,53)} width="325" height="190" className="imgStaff"  alt="lorem" /> : <img src={el.img} width="325" height="190" className="imgStaff"  alt="lorem" />}
-                                <div className="titlleAndPrice">
-                                    <h4>{el.title}</h4>
-                                    <h4>Цена: {el.price}</h4>
-                                </div>
-
+        if (isFetching === true) {
+            data = <div className="loader">
+                <Loader type="Triangle"
+                    color="#FD7F71"
+                    height="100"
+                    width="100"
+                />
+            </div>
+        } else {
+            data = <div className="staffs">
+                {inputStaffs.map((el, key) => (
+                    <Link to={`/staff/${el.id}`} key={key}>
+                        <div className="staff">
+                        {el.state ?  <img src={el.img.substr(0,53)} width="325" height="190" className="imgStaff"  alt="lorem" /> : <img src={el.img} width="325" height="190" className="imgStaff"  alt="lorem" />}
+                            <div className="titlleAndPrice">
+                                <h4>{el.title}</h4>
+                                <h4>Цена: {el.price}</h4>
                             </div>
-                        </Link> 
-                    ))}    
-                </div>
-            }
+                        </div>
+                    </Link>
+                ))}
+            </div>
+        }
         return (
 
-           <div className="contentStaffs">
+            <div className="contentStaffs">
                 {data}
-                <AddNewStaff isAdmin={ isAdmin } getUser={ getUser }/>
-           </div> 
-            
+                <AddNewStaff isAdmin={isAdmin} getUser={getUser} />
+            </div>
+
         );
     }
 }

+ 3 - 3
src/components/Auth/authButtons.js

@@ -5,14 +5,14 @@ class Authbuttons extends Component {
     render() {
         return (
             <div className="auth__button">
-                <Link to="/auth"  >
+                <Link to="/auth" >
                     <button className="button btn1">
-                        Войти
+                        Вход
                     </button>
                 </Link>
                 <Link to="/registration" >
                     <button className="button btn2">
-                        Зарегистрироваться
+                        Регистрация
                     </button>
                 </Link>
             </div>

+ 1 - 1
src/components/Auth/authorisation.js

@@ -40,7 +40,7 @@ const Form = props => {
                         className="input"
                     />
                 </div>
-               <button className="auth__submit-button" onClick={handleSubmit(submit)}><Link to="/">Войти</Link> </button>
+               <button className="auth__submit-button" onClick={handleSubmit(submit)}>Войти </button>
                
             </form>
         </div>

+ 7 - 9
src/components/Auth/registration.js

@@ -17,9 +17,8 @@ const RegistrForm = props => {
         postUsersData(values)
     }
 
-    return (   
-        <div className="formdiv">
-            <div>
+    return (
+        <div >
             <Authbuttons />
             <form onSubmit={handleSubmit(submit)} className="form">
                 <div>
@@ -72,22 +71,21 @@ const RegistrForm = props => {
                     </div>
                 </div>
                 <div>
-                    <button type="submit" 
-                        disabled={pristine} 
+                    <button type="submit"
+                        disabled={pristine}
                         className="button"
                     >
                         Отправить
                     </button>
-                    <button type="button" 
-                        disabled={pristine} 
-                        onClick={reset} 
+                    <button type="button"
+                        disabled={pristine}
+                        onClick={reset}
                         className="button"
                     >
                         Очистить поля
                     </button>
                 </div>
             </form>
-            </div>
         </div>
 
     )

+ 17 - 20
src/components/FormsAdd/FormAddNewStaff/SendingStaffForm.js

@@ -3,10 +3,10 @@ import { Field, reduxForm } from 'redux-form';
 
 import FormData from 'form-data'
 
-class SendingForm extends  Component  {
-
-    constructor(props){
+class SendingForm extends Component {
+    constructor(props) {
         super(props)
+
        this.state = { trig:false }
        
     }
@@ -67,11 +67,11 @@ class SendingForm extends  Component  {
                 base643(reader.result)         
             }
             reader.readAsDataURL(file);
+
     }
+
     submit = values => {
-        const { AddNewStaffAction,  getUser, photo } = this.props
-        //const { image } = this.state
-        
+        const { AddNewStaffAction, getUser, photo } = this.props      
         if(!this.state.trig){
             values.img = "http://rs.img.com.ua/crop?v2=1&w=600&h=0&url=%2F%2Fbm.img.com.ua%2Fberlin%2Fstorage%2Forig%2Fd224d3bd9bfe8bcb6b561da523d87364.jpg";
             values.state = 0
@@ -80,12 +80,12 @@ class SendingForm extends  Component  {
             values.img = `http://127.0.0.1:2000/static/${photo.map(el => el.data.fileName)}`; 
             values.state = 1 
          }
-        //values.img = `http://127.0.0.1:2000/static/${photo.map(el => el.data.fileName)}`  
         values.staff = "Машина"
        
         values.userId = getUser.id
         console.log(values)
         AddNewStaffAction(values)
+
     };
     render(){
         
@@ -95,6 +95,7 @@ class SendingForm extends  Component  {
         
     return (
         
+
             <div className="formdiv">
                 <form onSubmit={handleSubmit(this.submit)} className="form">
                     <Field
@@ -125,14 +126,15 @@ class SendingForm extends  Component  {
                     <Field
                         name="categoryId"
                         component="select"
-                        
+
                         className="input"
                     >
                         <option >Выберите рубрику</option>
                         {allCategory.map(el => <option value={el.id}> {el.title}</option>)}
                     </Field>
 
-                            
+
+                            <div className="file">
                                 <label className='upload-zone zone1'>
                                 {addOrnot ? <img src={base64Photo} style={{"width": "80px", "height": "80px"}}></img> : <i>&nbsp;</i>}
                                     <input type='file' className='files'  onChange={this.onChange}/>
@@ -153,14 +155,9 @@ class SendingForm extends  Component  {
                                     <input type='file' className='files'  onChange={this.onChange3}/>
                                     
                                 </label>
-                                
+                            </div> 
                             
                             
-                    {/* <input type="file"    onChange={this.onChange}></input> */}
-                    {/* <input type="file"    onChange={this.onChange1}></input>
-                    <input type="file"    onChange={this.onChange2}></input>
-                    <input type="file"    onChange={this.onChange3}></input> */}
-                
                     <div className="buttonConteiner">
                         <button type="submit" disabled={pristine || submitting} className="button" >
                             Submit
@@ -169,14 +166,14 @@ class SendingForm extends  Component  {
                             Clear Values
                         </button>
                     </div>
-                    
-                    
+
+
                 </form>
 
             </div>
-        
-    )
-  }
+
+        )
+    }
 }
 
 export default reduxForm({

+ 34 - 21
src/components/FormsAdd/redForm/index.js

@@ -1,6 +1,6 @@
 import React, { Component } from 'react';
 import { Field, reduxForm } from 'redux-form';
-
+import { Link, Redirect } from "react-router-dom";
 import FormData from 'form-data'
 
 
@@ -46,10 +46,8 @@ class FormRedactorStaff extends  Component  {
         
     }
     send = () =>{
-        const { inputData, inputData1, inputData2, inputData3, match, photo, EditStaffAction, InfoStaff, getUser } = this.props
-        
+        const { inputData, inputData1, inputData2, inputData3, match, photo, EditStaffAction, InfoStaff, getUser } = this.props  
         let values = {}
-   
         if(!this.state.trig){
             values.img = "http://rs.img.com.ua/crop?v2=1&w=600&h=0&url=%2F%2Fbm.img.com.ua%2Fberlin%2Fstorage%2Forig%2Fd224d3bd9bfe8bcb6b561da523d87364.jpg";
             values.state = 0
@@ -58,32 +56,43 @@ class FormRedactorStaff extends  Component  {
             values.img = `http://127.0.0.1:2000/static/${photo.map(el => el.data.fileName)}`; 
             values.state = 1 
          }
-        values.staff = "Машина"
-        values.title = inputData
-        values.description = inputData1
-        values.price = inputData2
-        values.categoryId = inputData3
+            values.title = inputData
+            values.description = inputData1
+            values.price = inputData2
+            values.categoryId = inputData3  
+        values.staff = "Машина"       
         values.userId = getUser.id
         values.id = InfoStaff[0].id
-          //EditStaffAction(values)
-          console.log(values)
+        if(values.title === ""){
+            InfoStaff.map(el => values.title = el.title)
+        }
+        if(values.description === ""){
+            InfoStaff.map(el => values.description = el.description)
+        }
+        if(values.price === null){
+            InfoStaff.map(el => values.price = el.price)
+        }
+        if(values.categoryId === null){
+            InfoStaff.map(el => values.categoryId = el.categoryId)
+        }
+          EditStaffAction(values)
+        
+          //console.log(values)
     }
     render(){
         
         
          const { handleSubmit, pristine, reset, submitting, InfoStaff, photo, allCategory } = this.props
-         console.log("InfoStaff", InfoStaff)
+         
          const category = allCategory.data.filter(el => el.parentId !== 0)
          let data;
-         if(this.props.InfoStaff[0].id === this.props.match.params.id){
-             data = []
-         }
-         else{
+         
+         
             data = InfoStaff.map(el => <form  className="form">
             <input type="text"  name="title" defaultValue ={el.title} className="input" onChange={this.changeHandler}/>
             <textarea type="text"  name="description" defaultValue ={el.description} className="input" onChange={this.changeHandler1}/>
             <input type="number"  name="price" defaultValue ={el.price} className="input" onChange={this.changeHandler2}/>
-            <select type="number"  name="categoryId"  className="input" onChange={this.changeHandler3}>
+            <select type="number"  name="categoryId"  className="input" defaultValue ={el.categoryId} onChange={this.changeHandler3}>
 
               <option >Выберите рубрику</option>
                     {category.map(el => <option value={el.id}> {el.title}</option>)}
@@ -112,10 +121,10 @@ class FormRedactorStaff extends  Component  {
                         
                
                 <div className="buttonConteiner">
-                    <button type="button" className="button" onClick={this.send}>
+                <button type="button" className="button" onClick={this.send}>
                         Submit
                     </button>
-                    <button type="button" disabled={pristine || submitting} onClick={reset} className="button" >
+                   <button type="button" disabled={pristine || submitting} onClick={reset} className="button" >
                         Clear Values
                     </button>
                    
@@ -124,7 +133,7 @@ class FormRedactorStaff extends  Component  {
                 
             </form>
           )
-         }
+         
     return (
         
             <div className="formdiv">
@@ -137,4 +146,8 @@ class FormRedactorStaff extends  Component  {
 
 export default reduxForm({
     form: 'RedactorForm'
-})(FormRedactorStaff)
+})(FormRedactorStaff)
+
+// {!this.state.trig ?   <button type="button" className="button" onClick={this.send}>
+//                         Submit
+//                     </button>: <Redirect to='/' /> }

+ 15 - 0
src/components/Modal/addNewStaffModal.js

@@ -0,0 +1,15 @@
+import React, { Component } from "react";
+import { Modal } from "antd";
+
+export default class EditModal extends Component {
+	render() {
+		
+		
+		const { visible, onOk, onCancel, error, str } = this.props;
+		  return (
+			<Modal title="" visible={visible} onCancel={onCancel} onOk={onOk}  >
+					{error==="error" ? <h4>Не все поля были заполнены</h4> : <h4>{str}</h4>}
+			</Modal>
+		  );
+	}
+}

+ 4 - 3
src/components/Modal/index.js

@@ -5,11 +5,12 @@ export default class EditModal extends Component {
 	render() {
 		
 		
-		const { visible, onOk, onCancel, error } = this.props;
+		const { visible, onOk, onCancel, str, inputData } = this.props;
 		  return (
-			<Modal title="" visible={visible} onCancel={onCancel} onOk={onOk} >
-				{error==="error" ? <h4>Не все поля были заполнены</h4> : <h4>Ваше объявление успешно добавлено</h4>}
+			<Modal title="" visible={visible} onCancel={onCancel} onOk={onOk}  >
+			<h4>{inputData ? str: "Данные введены не верно"}</h4>
 			</Modal>
 		  );
 	}
 }
+

+ 1 - 1
src/components/SearchStaffsPage/index.js

@@ -21,7 +21,7 @@ class searchStaffs extends Component {
                 data = <div className="staffs">
                       {searchData.map((el,key)=>(
                       <Link to = {`/search/Staff/${el.id}`}  key={key}  >
-                        <div className="staff" > {el.title} {el.price}  </div>
+                        <div className="staff" > {el.title} {el.price}  <img src={el.img} width="325" height="190" className="imgStaff"  alt="lorem" /></div>
                       </Link> 
                                                 )
                                     )}

+ 4 - 3
src/container/AddNewStaff.js

@@ -8,7 +8,7 @@ import { getUsersDataById } from "../actions/getUserById"
 import { bindActionCreators } from "redux";
 
 import FormAddNewStaff from '../components/FormsAdd/FormAddNewStaff';
-import EditModal from "../components/Modal";
+import EditModal from "../components/Modal/addNewStaffModal";
 
 class AddNewStaff extends Component {
     componentDidMount() {
@@ -27,8 +27,8 @@ class AddNewStaff extends Component {
         closeModal();
     }
     render() {
-        const { showModal, error, isFetching, AddNewStaffAction, getUser, photo, pushPhoto, base64, base64Photo, addOrnot } = this.props
-        console.log(base64Photo)
+        const { showModal, error } = this.props
+        const str = "Ваше объявление успешно добавлено"
         return (
 
             <Fragment>
@@ -41,6 +41,7 @@ class AddNewStaff extends Component {
                     onOk={this.closeEditModal}
                     onCancel={this.closeEditModal}
                     error={error}
+                    str={ str }
                 />
             </Fragment>
 

+ 7 - 3
src/container/CategoryStaffInfo.js

@@ -1,4 +1,4 @@
-import React, { Component } from 'react';
+import React, { Component, Fragment } from 'react';
 import { connect} from 'react-redux';
 import { getCategorysDataById } from "../actions/getStaffByCategoryIdAction";
 import { getUsersDataById } from "../actions/getUserById"
@@ -39,13 +39,17 @@ class CategoryStaffInfo extends Component {
         
        
         return (
-            <div>
+
+            <Fragment>
+  
+            
                 <Header  getUser={ getUser }/>
                 <div className="menuAndContent">
                     <LeftMenu  getUser={ getUser }/>
                     <CategoryStaffs infoCategory={infoCategory} isFetching={isFetching}  getUser={ getUser }  />
+
                 </div>
-            </div>
+            </Fragment>
         );
     }
 }

+ 2 - 2
src/container/MainPageStaffInfo.js

@@ -28,11 +28,11 @@ class MainPageStaffInfo extends Component {
             <Fragment>
 
                 <Header getUser={ getUser } />
-                
+                <div className="menuAndContent">
                     <LeftMenu getUser={ getUser }/>
                     <FullInfoAboutStaff {...this.props} />
+                </div>
 
-                
             </Fragment>
         );
     }

+ 19 - 16
src/container/SearchStaff.js

@@ -1,6 +1,8 @@
 import React, { Component, Fragment } from 'react';
-import { connect} from 'react-redux';
-import {searchStaff} from "../actions/searchStaffAction";
+
+import { connect } from 'react-redux';
+import { searchStaff } from "../actions/searchStaffAction";
+
 
 import { getUsersDataById } from "../actions/getUserById"
 
@@ -16,21 +18,22 @@ import Header from '../container/Header'
 
 
 class SearchStaff extends Component {
-    componentDidMount(){
+    componentDidMount() {
         const { searchStaff, match, getUsersDataById } = this.props
         searchStaff(match.params.title)
         let localS = JSON.parse(localStorage.getItem("login"));
-                if(localS===null){
-
-                }
-                else{
-                    getUsersDataById(localS)
-                }
-      }
-      render() {
-        const {  getUser } = this.props
-        
+        if (localS === null) {
+
+        }
+        else {
+            getUsersDataById(localS)
+        }
+    }
+    render() {
+        const { getUser } = this.props
+
         console.log(this.props)
+
         return ( 
           <Fragment>
           <Header  getUser={ getUser } />
@@ -40,7 +43,7 @@ class SearchStaff extends Component {
           </div>
           </Fragment>       
         );
-      }
+    }
 }
 
 
@@ -53,6 +56,6 @@ const mapStateToProps = state => ({
 const mapDispatchToProps = dispatch => bindActionCreators({ searchStaff, getUsersDataById }, dispatch);
 
 export default SearchStaff = connect(
-      mapStateToProps,
-      mapDispatchToProps
+    mapStateToProps,
+    mapDispatchToProps
 )(SearchStaff);

+ 7 - 5
src/container/SearchStaffsInfo.js

@@ -1,4 +1,4 @@
-import React, { Component } from 'react';
+import React, { Component, Fragment } from 'react';
 import { connect} from 'react-redux';
 import {getSeacrhStaffsDataById} from "../actions/searchStaffByIdAction";
 
@@ -25,11 +25,13 @@ class SearchInfoStaffsInfo extends Component {
     render() {
         const {  getUser } = this.props
         return (
-            <div>
+            <Fragment>
                 <Header getUser={ getUser } />
-                <LeftMenu getUser={ getUser } />
-                <SearchFullInfoStaff {...this.props}/>
-            </div>
+                <div className="menuAndContent">
+                    <LeftMenu getUser={ getUser } />
+                    <SearchFullInfoStaff {...this.props}/>
+                </div>
+            </Fragment>
         );
     }
 }

+ 27 - 22
src/container/UserProfile.js

@@ -1,4 +1,4 @@
-import React, { Component } from 'react';
+import React, { Component, Fragment } from 'react';
 
 import { Link } from "react-router-dom";
 
@@ -12,8 +12,10 @@ import { getParams } from "../actions/getUserById"
 
 import { bindActionCreators } from "redux";
 
+import Header from '../container/Header'
+
 class UserProfile extends Component {
-   
+
     singOut = () => {
         const { getParams, match } = this.props
         localStorage.removeItem("login")
@@ -22,31 +24,34 @@ class UserProfile extends Component {
 
     componentDidMount() {
         const { getUsersDataById } = this.props
-                console.log(this.props) ;
-               
+        console.log(this.props);
+
 
-              let localS = JSON.parse(localStorage.getItem("login"));
-                if(localS===null){
+        let localS = JSON.parse(localStorage.getItem("login"));
+        if (localS === null) {
 
-                }
-                else{
-                    getUsersDataById(localS)
-                }     
+        }
+        else {
+            getUsersDataById(localS)
+        }
     }
     render() {
         console.log(this.props)
-            const { getUser } = this.props
-            const { staffs } = this.props.getUser
+        const { getUser } = this.props
+        const { staffs } = this.props.getUser
         return (
-           <div>
-               {staffs!==undefined && <div> {getUser.name}
-                 {/* {staffs.map((el,key)=> <div key={key}> {el.title} </div> )} */}
-                 <Link to="/activeStaffs">Активные Товары</Link>
-                 <button onClick={this.singOut}><Link to="/">Выход</Link></button>
-             </div>
-               }
-           </div>
-                
+
+            <Fragment>
+                <Header getUser={ getUser } />
+                <div className="menuAndContent">
+                    {staffs !== undefined && <div className="profil"><h2>{getUser.name}</h2>
+                        
+                        <Link to="/activeStaffs">Активные Товары</Link>
+                        <button onClick={this.singOut}><Link to="/">Завершение сеанса</Link></button>
+                    </div>}
+                </div>
+            </Fragment>
+
         );
     }
 }
@@ -55,7 +60,7 @@ class UserProfile extends Component {
 const mapStateToProps = state => ({
     inputData: state.usersAuth.inputData,
     getUser: state.getUserById.getUser,
-    
+
 });
 
 const mapDispatchToProps = dispatch => bindActionCreators({ getUsersData, getUsersDataById, getParams }, dispatch);

+ 1 - 1
src/container/activeStaffs.js

@@ -8,7 +8,7 @@ import { connect } from 'react-redux';
 import { bindActionCreators } from "redux";
 const axios = require('axios')
 class activeStaffs extends Component {
-   
+    
     componentDidMount() {
         const { getUsersDataById } = this.props
                

+ 20 - 6
src/container/redactorForm.js

@@ -1,10 +1,10 @@
-import React, { Component } from 'react';
+import React, { Component, Fragment } from 'react';
 import { getUsersDataById } from "../actions/getUserById"
 import { getCategoriesData } from '../actions/categoryAction';
 import { getStaffsDataById } from "../actions/getStaffByIdAction"
-import { pushPhoto, inputchangeHandler, inputchangeHandler1, inputchangeHandler2, inputchangeHandler3, EditStaffAction } from "../actions/addNewStaffAction"; 
+import { pushPhoto, inputchangeHandler, inputchangeHandler1, inputchangeHandler2, inputchangeHandler3, EditStaffAction, closeModal } from "../actions/addNewStaffAction"; 
 import FormRedactorStaff from '../components/FormsAdd/redForm'
-
+import EditModal from "../components/Modal/addNewStaffModal";
 import { connect} from 'react-redux';
 import { bindActionCreators } from "redux";
 
@@ -28,15 +28,28 @@ class redactorForm extends Component {
         }     
 
     }
+    closeEditModal = () => {
+        const { closeModal } = this.props;
+        closeModal();
+    }
     render() {
         const { allCategory } = this.props
+        const str = "Объявление успешно отредактировано"
         let data; 
         if (allCategory.data===undefined){
             data = []
         }
         else{ 
             const category = allCategory.data.filter(el => el.parentId !== 0)
-            data = <FormRedactorStaff {...this.props}/>
+            data = <Fragment>
+            <FormRedactorStaff {...this.props}/>  
+            <EditModal visible={this.props.showModal}
+            onOk={this.closeEditModal}
+            onCancel={this.closeEditModal}
+ 
+            str={ str }   
+        /> 
+                </Fragment>
         }
        
         return (
@@ -56,10 +69,11 @@ const mapStateToProps = state => ({
     inputData: state.addStaff.inputData,
     inputData1: state.addStaff.inputData1,
     inputData2: state.addStaff.inputData2,
-    inputData3: state.addStaff.inputData3
+    inputData3: state.addStaff.inputData3,
+    showModal: state.addStaff.showModal,
   });
   
-  const mapDispatchToProps = dispatch => bindActionCreators({ getUsersDataById, getStaffsDataById, getCategoriesData, pushPhoto, inputchangeHandler, inputchangeHandler1, inputchangeHandler2, inputchangeHandler3, EditStaffAction }, dispatch);
+  const mapDispatchToProps = dispatch => bindActionCreators({ closeModal, getUsersDataById, getStaffsDataById, getCategoriesData, pushPhoto, inputchangeHandler, inputchangeHandler1, inputchangeHandler2, inputchangeHandler3, EditStaffAction }, dispatch);
   
   export default redactorForm = connect(
         mapStateToProps,

+ 21 - 4
src/container/renderAuthorisation.js

@@ -3,13 +3,29 @@ import { bindActionCreators } from "redux";
 import { connect} from 'react-redux';
 
 import Form from "../components/Auth/authorisation";
-import { getUsersData } from "../actions/usersAuthActions";
+import { getUsersData, closeModal } from "../actions/usersAuthActions";
 
-class RenderAuthorisation extends Component {      
+import EditModal from "../components/Modal";
+
+class RenderAuthorisation extends Component { 
+  closeEditModal = () => {
+    const { closeModal } = this.props;
+    closeModal();
+}     
     render() {
+      const { showModal, inputData } = this.props
+      const str = "Данные введены верно";
+     
       return (
         <div>
+          
           <Form {...this.props} />
+          <EditModal visible={showModal}
+                    onOk={this.closeEditModal}
+                    onCancel={this.closeEditModal}
+                    str={ str }
+                    inputData={ inputData }
+                />
         </div>       
       );
     }
@@ -17,10 +33,11 @@ class RenderAuthorisation extends Component {
 
 
 const mapStateToProps = state => ({
-  inputData: state.usersAuth.inputData
+  inputData: state.usersAuth.inputData,
+  showModal: state.usersAuth.showModal
 });
 
-const mapDispatchToProps = dispatch => bindActionCreators({ getUsersData }, dispatch);
+const mapDispatchToProps = dispatch => bindActionCreators({ getUsersData, closeModal }, dispatch);
 
 export default RenderAuthorisation = connect(
   mapStateToProps,

+ 19 - 4
src/container/renderRegistration.js

@@ -3,23 +3,38 @@ import { bindActionCreators } from "redux";
 import { connect } from 'react-redux';
 
 import RegistrForm from "../components/Auth/registration";
-import * as actions from "../actions/usersRegistrActions";
+import { postUsersData, closeModal } from "../actions/usersRegistrActions";
+
+import EditModal from "../components/Modal";
 
 class RenderRegistration extends Component {
+    closeEditModal = () => {
+        const { closeModal } = this.props;
+        closeModal();
+    } 
     render() {
+        const str = "Вы успешно зарегестрировались";
         return (
-            <Fragment>
+            <div className="formdiv">
                 <RegistrForm {...this.props} />
-            </Fragment>
+                <EditModal visible={this.props.showModal}
+                    onOk={this.closeEditModal}
+                    onCancel={this.closeEditModal}
+                    str={ str }
+                    inputData={ this.props.inputData }
+                />
+            </div>
         );
     }
 }
 
 
 const mapStateToProps = state => ({
+    showModal: state.usersRegistr.showModal,
+    inputData: state.usersRegistr.inputData
 });
 
-const mapDispatchToProps = dispatch => bindActionCreators({ ...actions }, dispatch);
+const mapDispatchToProps = dispatch => bindActionCreators({ postUsersData, closeModal }, dispatch);
 
 export default RenderRegistration = connect(
     mapStateToProps,

+ 2 - 1
src/reducer/addStaff.js

@@ -35,7 +35,8 @@ export default ( state = initState, { type, payload } ) => {
                 ...state,
                 staffData: state.staffData.concat(JSON.parse(payload.config.data)),
                 isFetching:false,
-                showModal: true
+                showModal: true,
+                error: null
             }
         }
         case types.ADD_NEW_STAFF_REQUEST_FAIL: {

+ 11 - 2
src/reducer/usersAuthorisation.js

@@ -3,8 +3,9 @@ import * as types from "../constants/actionTypes";
 const initState = {
     inputData: [],
     isFetching: false,
-    error: null,
-    trig: true
+    
+    trig: true,
+    showModal: false
   };
 
 export default (state = initState, {type, payload} ) => {
@@ -29,6 +30,8 @@ export default (state = initState, {type, payload} ) => {
                 ...state,
                 inputData: payload.data,
                 isFatching: false,
+                showModal: true,
+                
             }
         }
         case types.USER_AUTH_REQUEST_FAIL: {
@@ -38,6 +41,12 @@ export default (state = initState, {type, payload} ) => {
                 error: "ERROR",
             }
         }
+        case types.CLOSE_MODAL_WINDOW: {
+            return {
+                ...state,
+                showModal: false
+            }
+        }
         
         
         default: return state;

+ 11 - 2
src/reducer/usersRegistration.js

@@ -3,10 +3,12 @@ import * as types from "../constants/actionTypes";
 const initState = {
     inputData: [],
     isFetching: false,
-    error: null
+    error: null,
+    showModal: false
   };
 
   export default (state = initState, { type, payload }) => {
+    console.log(payload)
       switch (type) {
         case types.USER_REG_REQUEST: {
           return {
@@ -20,7 +22,8 @@ const initState = {
           return {
             ...state,
             isFetching: false,
-            inputDate: payload.data
+            inputData: payload.data,
+            showModal: true
           }
         }
 
@@ -31,6 +34,12 @@ const initState = {
             error: "ERROR"
           }
         }
+        case types.CLOSE_MODAL_WINDOW: {
+          return {
+              ...state,
+              showModal: false
+          }
+      }
         
         default: return state;    
     }

+ 0 - 1
src/router.js

@@ -59,7 +59,6 @@ class Router extends Component {
             <Route path="/addCategory" exact component={AddNewCategory} />
             <Route path="/activeStaffs" exact component={ ActiveStaffs } />
             <Route path="/activeStaffs/:id" exact component={ redactorForm } />
-           
 	    </Switch>
     </div>
        )

+ 1 - 1
src/style/base/_base.scss

@@ -7,7 +7,7 @@
 }
 body{
 	min-width: 980px;
-	max-width: 1400px;
+	max-width: 1520px;
 	width: 100%;
 	margin: 0 auto ;
 	background: $color-backgtound;

+ 126 - 0
src/style/components/_allStaff.scss

@@ -42,9 +42,44 @@
 
     .imgStaff{
         width: 100%;
+        height: 80%;
         padding: 5px ;
        
     }
+    .staffinfo{
+        width: 100%;
+        height: 100%;
+        margin: 10px;
+        padding: 1%;
+        border: none;
+        outline: none;
+        border: 0px;
+        cursor: pointer;
+        color: #FD7F71;
+        transition: .3s ease-out;
+        border-radius: 10px;
+        background-color: #fff;
+        box-shadow: 0 1px 1px rgba(187, 216, 216, 0.6), 
+            0 3px 3px rgba(187, 216, 216, 0.4), 
+            0 8px 16px rgba(187, 216, 216, 0.3);
+
+        .titlleAndPrice{
+            display: flex;
+            justify-content: space-around;
+            padding-top: 10px;
+
+        }
+
+        .fullImgStaff{
+            width: 480px;
+            height: 320px;
+            border: none;
+            outline: none;
+            border: 1px;
+            border-radius: 10px;    
+            animation-timing-function: linear;
+        }
+    }
 
     .loader{
         position: fixed;
@@ -109,6 +144,97 @@
 // }
 
 
+.carusel{
+    border: none;
+        outline: none;
+        border: 0px;
+    border-radius: 10px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+.viwe-carusel{
+    height: 100%;
+    width: var(--main-width);
+    display: flex;
+    flex-direction: row;
+    overflow: hidden;
+}
+.el-carusel{
+    height: 100%;
+    border: none;
+        outline: none;
+        border: 0px;
+    border-radius: 10px;
+    width: var(--main-width);
+    user-select: none;
+    animation-timing-function: linear;
+}
+.el-carusel::befor{
+    animation: eye 3s ease-in-out infinite;
+}
+.scropl-carusel{
+    width: 99999px;
+    display: flex;
+    transition: all 2s ease-in-out;
+}
+.scropl-carusel-finish{
+    width: 99999px;
+    display: flex;
+    transition: all 0s ease-in-out;
+}
+.img-carusel{
+  width: 100%;
+  height: 100%;
+}
+.but{
+  display: flex;
+  font-size: 2rem;
+  color: #424271;
+  background-color: #efeded;
+  height: 50px;
+  width: 50px;
+  /*position: relative;
+  top: 125px;*/
+  transform: translate(100%);
+  font-weight: bold;
+  opacity: 0.5;
+  user-select: none;
+}
+.but:hover{
+  color: #ccd024;
+  cursor: pointer;
+  opacity: 1;
+}
+.back{
+  z-index: 1;
+  align-items: center;
+  justify-content: center;
+  /*transform: translateX(100%);*/
+}
+.next{
+  z-index: 1;
+  align-items: center;
+  justify-content: center;
+  transform: rotate(180deg) translate(100%);
+}
+
+
+.ant-carousel{
+    width: 480px;
+}
 
+.ant-carousel .slick-slide {
+    width: 480px;
+    text-align: center;
+    height: 320px;
+    line-height: 160px;
+    overflow: hidden;
+  }
   
+  .ant-carousel .slick-slide h3 {
+    color: #fff;
+  }
+
+ 
 

+ 9 - 6
src/style/components/_form.scss

@@ -12,17 +12,12 @@
     
     .form {
         box-sizing: border-box;
-        width: 460px;
+        width: 500px;
         box-shadow: 2px 2px 5px 1px rgba(0,0,0,0.2);
         padding-bottom: 40px;
         border-radius: 3px;
         background-color: rgba(247, 240, 240, 0.7);
         
-        
-        h1 {
-            box-sizing: border-box;
-            padding: 20px;
-        }
     }
 
     .input {
@@ -86,6 +81,11 @@
         }
     }
 
+    .file{
+        width: 100%;
+        height: 100px;
+    }
+
     .buttonConteiner{
         display: flex;
         justify-content: center;
@@ -237,4 +237,7 @@ input[type=number]::-webkit-outer-spin-button {
   .zone4{
     left: 63%;
     top: 60%;
+  }
+  .auth__button{
+    
   }

+ 0 - 2
src/style/components/_formLogin.scss

@@ -186,12 +186,10 @@ h1, .input::-webkit-input-placeholder, .button {
     background-color: #FD7F71
   }
   .auth__button{
-  
     width: 100%;
     display : flex;
     padding-top: 30px;
     padding-bottom: 30px;
-    
   }
   .btn1{
     width: 180px;

+ 14 - 0
src/style/components/_userProfil.scss

@@ -0,0 +1,14 @@
+.profil{
+    width: 100%;
+    height: 75vh;
+    margin: 10px;
+    padding: 1%;
+    border: none;
+    border: 0px;
+    color: #FD7F71;
+    border-radius: 10px;
+    background-color: #fff; 
+    h2{
+        text-align: center;
+    }
+}

+ 4 - 3
src/style/index.scss

@@ -6,11 +6,12 @@
 
 @import "layout/container";
 
-@import "components/header";
 @import "components/allStaff";
-@import "components/leftMenu";
-// @import "components/formLogin";
 @import "components/form";
+// @import "components/formLogin";
+@import "components/header";
+@import "components/leftMenu";
+@import "components/userProfil";
 
 // @import './components/auth.scss';
 

+ 1 - 1
src/utils/authValidate.js

@@ -2,8 +2,8 @@ export const authValidate =  values => {
     const { email, password } = values;
     const error = {};
 
-
     if(!email) {
+        
         error.email = "Required"
     } else if (!/^[A-Z0-9._%+-]+@[A-Z0-9.]+\.[A-Z]{2,4}$/i.test(email)) {
         error.email = 'Invalid email address'