maryluis 3 vuotta sitten
vanhempi
commit
e7eef48095
47 muutettua tiedostoa jossa 107 lisäystä ja 130 poistoa
  1. 6 0
      shop/.htaccess
  2. BIN
      shop/public/pizza_profile.png
  3. BIN
      shop/public/standartProfile.jpg
  4. 7 2
      shop/src/App.css
  5. 1 1
      shop/src/App.js
  6. 0 0
      shop/src/actions/actionAuthLog.js
  7. 2 2
      shop/src/reducers/reducerCat.js
  8. 1 1
      shop/src/reducers/actionFindOneUser.js
  9. 1 1
      shop/src/reducers/actionGoodCard.js
  10. 1 1
      shop/src/reducers/actionGoodUpdate.js
  11. 1 1
      shop/src/reducers/actionGoods.js
  12. 1 1
      shop/src/reducers/actionLogin.js
  13. 1 1
      shop/src/reducers/actionOrder.js
  14. 1 1
      shop/src/reducers/actionOrdersFind.js
  15. 0 0
      shop/src/actions/actionPromise.js
  16. 1 1
      shop/src/reducers/actionReg.js
  17. 1 2
      shop/src/reducers/actionSearchUser.js
  18. 1 1
      shop/src/reducers/actionUpdateImg.js
  19. 1 1
      shop/src/reducers/actionUpdateOrder.js
  20. 1 1
      shop/src/reducers/actionUserUpdate.js
  21. 1 1
      shop/src/reducers/actionWishSearch.js
  22. 1 1
      shop/src/reducers/actionsearch.js
  23. 0 0
      shop/src/actions/getData.js
  24. 0 0
      shop/src/actions/gql.js
  25. 0 0
      shop/src/actions/index.js
  26. 6 5
      shop/src/components/Main.js
  27. 3 3
      shop/src/components/basket.js
  28. 2 2
      shop/src/components/catalog.js
  29. 1 14
      shop/src/components/goodCard.js
  30. 3 3
      shop/src/components/goodsCategory.js
  31. 2 2
      shop/src/components/goodsList.js
  32. 0 0
      shop/src/components/goods/goodsNotFound.js
  33. 3 3
      shop/src/components/goodsSearch.js
  34. 9 0
      shop/src/components/goods/index.js
  35. 0 0
      shop/src/components/goods/oneGood.js
  36. 1 1
      shop/src/components/searchInput.js
  37. 2 2
      shop/src/components/wishesPage.js
  38. 16 16
      shop/src/components/index.js
  39. 0 29
      shop/src/components/layout.js
  40. 0 0
      shop/src/components/orders/orderDonePage.js
  41. 2 2
      shop/src/components/orderUpdate.js
  42. 1 1
      shop/src/components/ordersList.js
  43. 1 1
      shop/src/components/loginOnPage.js
  44. 4 4
      shop/src/components/profilePage.js
  45. 3 4
      shop/src/components/usersList.js
  46. 0 0
      shop/src/history.js
  47. 18 18
      shop/src/reducers/index.js

+ 6 - 0
shop/.htaccess

@@ -0,0 +1,6 @@
+RewriteEngine on
+# If a directory or a file exists, use the request directly
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+# Otherwise forward the request to index.html
+RewriteRule . index.html [L]

BIN
shop/public/pizza_profile.png


BIN
shop/public/standartProfile.jpg


+ 7 - 2
shop/src/App.css

@@ -164,7 +164,7 @@ button:disabled {
 }
 
 
-content {
+.content {
   width: 80%;
 }
 .goodsNotFound {
@@ -428,6 +428,11 @@ button {
   width: 80%;
 
 }
+.empty {
+  display: flex;
+  width: 0%;
+}
+
 .basketgoodsInner {
   display: flex;
   justify-content: center;
@@ -664,7 +669,7 @@ button {
   }
 
 
-  .MainImg content {
+  .MainImg .content {
     width: 100%;
   }
   .subCatalog .subLink li {

+ 1 - 1
shop/src/App.js

@@ -1,6 +1,6 @@
 
 import './App.css';
-import history from "./reducers/history"
+import history from "./history"
 import {Provider, connect} from 'react-redux';
 import {Header, Footer, actionCatalogCard, Main, SearchInput} from "./components/index"
 import {BrowserRouter as Router, Route, Link, Switch, Redirect} from 'react-router-dom';

shop/src/reducers/actionAuthLog.js → shop/src/actions/actionAuthLog.js


+ 2 - 2
shop/src/reducers/reducerCat.js

@@ -2,7 +2,7 @@
 import {Provider, connect} from 'react-redux';
 import {createStore, combineReducers, applyMiddleware} from 'redux';
 import thunk from 'redux-thunk';
-import {actionPromise} from "./index"
+import {actionPromise} from "../reducers/index"
 
 
 ///reducer, где набор экшн.типов + функции.(если - то)
@@ -17,7 +17,7 @@ import {actionPromise} from "./index"
 
 
 
-import {gql} from "./index"
+import {gql} from "../reducers/index"
 
 
 

+ 1 - 1
shop/src/reducers/actionFindOneUser.js

@@ -1,4 +1,4 @@
-import {actionPromise, gql} from "./index";
+import {actionPromise, gql} from "../reducers/index";
 
 
 

+ 1 - 1
shop/src/reducers/actionGoodCard.js

@@ -1,4 +1,4 @@
-import {actionPromise, gql} from "./index";
+import {actionPromise, gql} from "../reducers/index";
 
 
 const actionGoodCard = (_id) => {

+ 1 - 1
shop/src/reducers/actionGoodUpdate.js

@@ -1,4 +1,4 @@
-import {actionPromise, gql} from "./index";
+import {actionPromise, gql} from "../reducers/index";
 
 
 const actionGoodUpdate = (data) => {

+ 1 - 1
shop/src/reducers/actionGoods.js

@@ -1,7 +1,7 @@
 import {Provider, connect} from 'react-redux';
 import {createStore, combineReducers, applyMiddleware, bindActionCreators} from 'redux';
 import thunk from 'redux-thunk';
-import {actionPromise, gql} from "./index";
+import {actionPromise, gql} from "../reducers/index";
 
 import { useEffect } from 'react';
 

+ 1 - 1
shop/src/reducers/actionLogin.js

@@ -1,7 +1,7 @@
 import {Provider, connect} from 'react-redux';
 import {createStore, combineReducers, applyMiddleware, bindActionCreators} from 'redux';
 import thunk from 'redux-thunk';
-import {actionPromise, actionAuthLogout, actionAuthLogin, gql, actionUserFindOne} from "./index"
+import {actionPromise, actionAuthLogout, actionAuthLogin, gql, actionUserFindOne} from "../reducers/index"
 import { useEffect } from 'react';
 
 

+ 1 - 1
shop/src/reducers/actionOrder.js

@@ -1,4 +1,4 @@
-import {actionPromise, gql} from "./index";
+import {actionPromise, gql} from "../reducers/index";
 
 
 

+ 1 - 1
shop/src/reducers/actionOrdersFind.js

@@ -1,4 +1,4 @@
-import {actionPromise, gql} from "./index";
+import {actionPromise, gql} from "../reducers/index";
 
 
 

shop/src/reducers/actionPromise.js → shop/src/actions/actionPromise.js


+ 1 - 1
shop/src/reducers/actionReg.js

@@ -1,4 +1,4 @@
-import {actionPromise, actionAuthLogout, actionAuthLogin, gql} from "./index"
+import {actionPromise, actionAuthLogout, actionAuthLogin, gql} from "../reducers/index"
 
 
 const actionReg = (login, password) =>{

+ 1 - 2
shop/src/reducers/actionSearchUser.js

@@ -1,4 +1,4 @@
-import {actionPromise, gql} from "./index";
+import {actionPromise, gql} from "../reducers/index";
 
 
 let toRegexp = (str) => {
@@ -10,7 +10,6 @@ let toRegexp = (str) => {
   let toQuery = (str, fields = ["login", "nick", "_id"]) => {
     str = toRegexp(str);
     let arr = fields.map((s) => {
-        console.log(s, typeof s);
         return { [s]: str };
     });
     return { $or: arr };

+ 1 - 1
shop/src/reducers/actionUpdateImg.js

@@ -1,5 +1,5 @@
 
-import {gql, urlUpload, actionPromise} from "./index";
+import {gql, urlUpload, actionPromise} from "../reducers/index";
 
 const actionImgOne = (_id) => {
   const queryJson = JSON.stringify([{

+ 1 - 1
shop/src/reducers/actionUpdateOrder.js

@@ -1,4 +1,4 @@
-import {actionPromise, gql} from "./index";
+import {actionPromise, gql} from "../reducers/index";
 
 
 

+ 1 - 1
shop/src/reducers/actionUserUpdate.js

@@ -1,4 +1,4 @@
-import {actionPromise, gql} from "./index";
+import {actionPromise, gql} from "../reducers/index";
 
 
 const actionUserUpdate = (data) => {

+ 1 - 1
shop/src/reducers/actionWishSearch.js

@@ -1,5 +1,5 @@
 import actionPromise from "./actionPromise";
-import {gql} from "./";
+import {gql} from "../reducers";
 
 
 

+ 1 - 1
shop/src/reducers/actionsearch.js

@@ -1,5 +1,5 @@
 import actionPromise from "./actionPromise";
-import {gql} from "./";
+import {gql} from "../reducers";
 
 
 

shop/src/reducers/getData.js → shop/src/actions/getData.js


shop/src/reducers/gql.js → shop/src/actions/gql.js


+ 0 - 0
shop/src/actions/index.js


+ 6 - 5
shop/src/components/Main.js

@@ -5,7 +5,7 @@ import {Provider, connect} from 'react-redux';
 import {createStore, combineReducers, applyMiddleware} from 'redux';
 import thunk from 'redux-thunk';
 import store from "../reducers";
-import Catalog from "./catalog";
+import Catalog from "./goods/catalog";
 import {actionCatalogCard, CBasketPage, searchInput, CGoodsCategory, 
     SearchInput, CGoodsSearch, LoginForm, CGoodCard, CYourProfile,
     COrderPage, CUsersList, COrdersList, COrderUpdate, CWishesPage, CGoodsList} from "./index";
@@ -31,11 +31,12 @@ const Main = ({className = "MainImg" }) => {
                             <Route path = "/search/"component={Catalog} />
                             <Route path = "/good/:id" component={(window.innerWidth > 900) && Catalog} />
                             <Route path = "/orderPage/" component = {Catalog}/>
+                            <Route component = { Empty } exact/>
                         </Switch>
                     </aside>
 
 
-                <content>
+                <div className = "content">
                     <Switch>
                         <Route path = "/" component = {About} exact/>
                         <Route path = "/catalog/" component={MainCatalog} exact/>
@@ -56,7 +57,7 @@ const Main = ({className = "MainImg" }) => {
                         <Route path = "/loginError" component={LoginError} />
                         <Route component = { NotFound } exact/>
                     </Switch>
-                </content>
+                </div>
             </div>
         </div>
         <div className = "bottom">
@@ -82,7 +83,7 @@ const LoginError = () => {
         </div>
         </>
     )}
-const MainMag = () => <div>Я тут кароче самый главный страниц</div>
+
 const About = () => 
     <div className = "basketNoGoods">
 
@@ -109,7 +110,7 @@ const NotFound = () => {
 }
 {/* <div> <h5 className = "profilePage">Ой, щось пішло не так. Мабудь цієї сторінки немає, або сталася помилка. Спробуйте ще.</h5></div> */}
 const MainCatalog = () => <div></div>
-const Post = () => <div className = "post">Точно не знаю зачем это, возможно потом уберу. Но в некоторых магазинах есть такое</div>
+const Empty = () => <div className = "empty"></div>
 const Contacts = () => 
     <div className = "order">
         <h4>Як ви нас зможете знайти:</h4>

+ 3 - 3
shop/src/components/basket.js

@@ -1,11 +1,11 @@
 import { useEffect, useState } from "react";
 import { connect } from "react-redux";
-import{OneGood} from "../components";
+import{OneGood} from "..";
 import {createStore, combineReducers, applyMiddleware, bindActionCreators} from 'redux';
 import {gql, urlUpload, actionPromise, actionGoodCard, getGoods, actionGoods, 
-    actionCartAdd, actionCartDelete, actionCartClear, actionOrder} from "../reducers";
+    actionCartAdd, actionCartDelete, actionCartClear, actionOrder} from "../../reducers";
 import { useHistory } from "react-router-dom";
-import COrderPage from "./orderDonePage";
+import COrderPage from "../orders/orderDonePage";
 
 
 

+ 2 - 2
shop/src/components/catalog.js

@@ -1,9 +1,9 @@
 import { Provider, connect } from 'react-redux';
 import { useEffect, useState } from 'react'
-import { Header, Footer, MainImg, Links } from "./index"
+import { Header, Footer, MainImg, Links } from "../index"
 import thunk from 'redux-thunk';
 import { bindActionCreators } from 'redux';
-import actionCatalogCard from './../reducers/reducerCat';
+import actionCatalogCard from '../../actions/actionCategory';
 import {BrowserRouter as Router, Route, Link, Switch, Redirect, useHistory} from 'react-router-dom';
 
 

+ 1 - 14
shop/src/components/goodCard.js

@@ -1,5 +1,5 @@
 import { connect } from "react-redux";
-import {gql, urlUpload, actionGoodUpdate, actionPromise, actionGoodCard, updateImgAction, getData, actionCartAdd} from "../reducers";
+import {gql, urlUpload, actionGoodUpdate, actionPromise, actionGoodCard, updateImgAction, getData, actionCartAdd} from "../../reducers";
 import {createStore, combineReducers, applyMiddleware, bindActionCreators} from 'redux';
 import { useEffect, useState, useRef } from 'react';
 import {BrowserRouter as Router, Route, Link, Switch, Redirect, useHistory} from 'react-router-dom';
@@ -53,19 +53,6 @@ import {BrowserRouter as Router, Route, Link, Switch, Redirect, useHistory} from
     const [price, changePrice] = useState(null);
     const [name, changeName] = useState(null);
 
-    useEffect(() => startWidth !== finallyWidth && window.location.reload(), [startWidth, finallyWidth])
-
-
-    window.onresize = () => {
-
-      width > 900 ? setStartwidth(true) : setStartwidth(false);
-
-      setWidth(window.innerWidth);
-
-      width > 900 ? setFinallyWidth(true) : setFinallyWidth(false);
-
-      }
-      // console.log(goodCard)
 
      return(
         <> 

+ 3 - 3
shop/src/components/goodsCategory.js

@@ -1,10 +1,10 @@
 import {Provider, connect} from 'react-redux';
 import {createStore, combineReducers, applyMiddleware, bindActionCreators} from 'redux';
 import thunk from 'redux-thunk';
-import {actionPromise} from "./index"
-import {gql, actionGoods, actionOrderAddNewGood, actionWishAdd, getData, actionCartAdd, actionWishDelete} from "../reducers/";
+import {actionPromise} from "../index"
+import {gql, actionGoods, actionOrderAddNewGood, actionWishAdd, getData, actionCartAdd, actionWishDelete} from "../../reducers/index";
 import { useEffect } from 'react';
-import {OneGood, CGoodsList} from "./index";
+import {OneGood, CGoodsList} from "../index";
 
 
   

+ 2 - 2
shop/src/components/goodsList.js

@@ -1,6 +1,6 @@
-import {OneGood, GoodsNotFound} from "./index";
+import {OneGood, GoodsNotFound} from "../index";
 import {createStore, combineReducers, applyMiddleware, bindActionCreators} from 'redux';
-import {getData, actionGoods, actionOrderAddNewGood, urlUpload} from "../reducers/index";
+import {getData, actionGoods, actionOrderAddNewGood, urlUpload} from "../../reducers/index";
 import {Provider, connect} from 'react-redux';
 import {BrowserRouter as Router, Route, Link, Switch, Redirect, useHistory} from 'react-router-dom';
 

shop/src/components/goodsNotFound.js → shop/src/components/goods/goodsNotFound.js


+ 3 - 3
shop/src/components/goodsSearch.js

@@ -1,10 +1,10 @@
 import {Provider, connect} from 'react-redux';
 import {createStore, combineReducers, applyMiddleware, bindActionCreators} from 'redux';
 import thunk from 'redux-thunk';
-import {actionPromise} from "./index"
-import {gql, actionGoods, actionWishDelete, actionWishAdd, getData, actionSearch, actionCartAdd} from "../reducers/index";
+import {actionPromise} from "../index"
+import {gql, actionGoods, actionWishDelete, actionWishAdd, getData, actionSearch, actionCartAdd} from "../../reducers/index";
 import { useEffect } from 'react';
-import {OneGood, CGoodsList} from "./index";
+import {OneGood, CGoodsList} from "../index";
 
 
 const mapStateToProps = state => ({

+ 9 - 0
shop/src/components/goods/index.js

@@ -0,0 +1,9 @@
+import CGoodCard from "./goodCard";
+import CGoodsCategory from "./goodsCategory";
+import CGoodsList from "./goodsList";
+import GoodsNotFound from "./goodsNotFound";
+import OneGood from "./oneGood";
+
+
+
+export {CGoodCard, CGoodsCategory, CGoodsList, GoodsNotFound, OneGood};

shop/src/components/oneGood.js → shop/src/components/goods/oneGood.js


+ 1 - 1
shop/src/components/searchInput.js

@@ -1,5 +1,5 @@
 import {useState} from "react";
-import {store, actionSearch} from "../reducers";
+import {store, actionSearch} from "../../reducers";
 import {BrowserRouter as Router, Route, Link, Switch, Redirect} from 'react-router-dom';
 import { useHistory } from "react-router-dom";
 

+ 2 - 2
shop/src/components/wishesPage.js

@@ -1,9 +1,9 @@
 import { Provider, connect } from 'react-redux';
 import { bindActionCreators } from 'redux';
 import { useHistory } from "react-router-dom";
-import {actionSearch, actionOrderAddNewGood, actionWishes, actionWishDelete, actionWishAdd, actionCartAdd, getData, actionAuthLogout, actionUserFindOne} from "../reducers"
+import {actionSearch, actionOrderAddNewGood, actionWishes, actionWishDelete, actionWishAdd, actionCartAdd, getData, actionAuthLogout, actionUserFindOne} from "../../reducers"
 import React, {Component, useState, useEffect} from 'react';
-import {OneGood, CGoodsList} from "./index";
+import {OneGood, CGoodsList} from "../index";
 
 const WishesPage = ({arr, state, getGoods, goods = [], wishes, onAdd, addWish, delWish, onAddtoOrder}) => {
     const history = useHistory();

+ 16 - 16
shop/src/components/index.js

@@ -4,23 +4,23 @@ import {createStore, combineReducers, applyMiddleware} from 'redux';
 import Header from "./header";
 import Footer from "./footer";
 import Main from "./Main";
-import actionCatalogCard from "../reducers/reducerCat";
+import actionCatalogCard from "../actions/actionCategory";
 import Links from "./links"
-import CGoodsCategory from "./goodsCategory";
-import OneGood from './oneGood';
-import CGoodsList from "./goodsList";
-import {SearchInput, SearchUserInput} from "./searchInput";
-import CGoodsSearch from "./goodsSearch";
-import GoodsNotFound from "./goodsNotFound";
-import LoginForm from "./loginOnPage";
-import CGoodCard from "./goodCard";
-import CYourProfile from "./profilePage";
-import CBasketPage from "./basket";
-import COrderPage from "./orderDonePage";
-import CUsersList from "./usersList";
-import COrdersList from "./ordersList";
-import COrderUpdate from "./orderUpdate";
-import CWishesPage from "./wishesPage";
+// import CGoodsCategory from "./goods/goodsCategory";
+// import OneGood from './goods/oneGood';
+// import CGoodsList from "./goods/goodsList";
+import {SearchInput, SearchUserInput} from "./goods/searchInput";
+import CGoodsSearch from "./goods/goodsSearch";
+// import GoodsNotFound from "./goods/goodsNotFound";
+import LoginForm from "./users/loginOnPage";
+import {CGoodCard, CGoodsCategory, CGoodsList, GoodsNotFound, OneGood} from "./goods/index";
+import CYourProfile from "./users/profilePage";
+import CBasketPage from "./goods/basket";
+import COrderPage from "./orders/orderDonePage";
+import CUsersList from "./users/usersList";
+import COrdersList from "./orders/ordersList";
+import COrderUpdate from "./orders/orderUpdate";
+import CWishesPage from "./goods/wishesPage";
 
 
 export {Header,Footer, actionCatalogCard, Main, Links, CGoodsCategory, OneGood, CGoodsList, SearchInput, CGoodsSearch, GoodsNotFound, 

+ 0 - 29
shop/src/components/layout.js

@@ -1,29 +0,0 @@
-import React, { useState } from 'react';
-import {BrowserRouter as Router, Route, Link, Switch, Redirect} from 'react-router-dom';
-import createHistory from "history/createBrowserHistory";
-import {Header, Footer} from "./index"
-import MainImg from "./MainImg"
-
-
-
-
-
-const Layout =({}) =>{
-    return(
-        <>
-
-
-        </>
-    )
-}
-
-
-
-
-
-
-
-
-
-export default Layout;
-

shop/src/components/orderDonePage.js → shop/src/components/orders/orderDonePage.js


+ 2 - 2
shop/src/components/orderUpdate.js

@@ -1,6 +1,6 @@
-import { actionOrdersFind, actionOrderUpdate, actionOrderClear, actionOrderAddOne, actionOrderFindOne, urlUpload, actionOrderDelete} from "../reducers";
+import { actionOrdersFind, actionOrderUpdate, actionOrderClear, actionOrderAddOne, actionOrderFindOne, urlUpload, actionOrderDelete} from "../../reducers";
 import { connect } from "react-redux";
-import {OneGood, GoodsNotFound} from "./index";
+import {OneGood, GoodsNotFound} from "../index";
 import { useEffect, useState, useRef } from "react";
 import {BrowserRouter as Router, Route, Link, Switch, Redirect, useHistory} from 'react-router-dom';
 import {createStore, combineReducers, applyMiddleware, bindActionCreators} from 'redux';

+ 1 - 1
shop/src/components/ordersList.js

@@ -1,4 +1,4 @@
-import { actionOrdersFind, urlUpload, actionOrderAdd, actionOrderAddOrder} from "../reducers";
+import { actionOrdersFind, urlUpload, actionOrderAdd, actionOrderAddOrder} from "../../reducers";
 import { connect } from "react-redux";
 import { useEffect, useState, useRef } from "react";
 import {BrowserRouter as Router, Route, Link, Switch, Redirect, useHistory} from 'react-router-dom';

+ 1 - 1
shop/src/components/loginOnPage.js

@@ -5,7 +5,7 @@ import {createStore, combineReducers, applyMiddleware} from 'redux';
 import thunk from 'redux-thunk';
 import jwt_decode from "jwt-decode"
 import { bindActionCreators } from 'redux';
-import {actionLogin, authReducer, actionAuthLogout, actionReg} from "../reducers/";
+import {actionLogin, authReducer, actionAuthLogout, actionReg} from "../../reducers";
 
 const actionClearLogin = () => ({
     

+ 4 - 4
shop/src/components/profilePage.js

@@ -1,13 +1,13 @@
-import {CUsersList, SearchUserInput, CUpdateAdminForm} from "./index";
+import {CUsersList, SearchUserInput, CUpdateAdminForm} from "../index";
 import {gql, urlUpload, actionPromise, actionGoodCard, getGoods,
     actionUserFindOne, updateImgAction, actionAuthLogin, actionAuthLogout,
-    actionUserUpdate, actionOrdersFind, getData, actionLogin } from "../reducers";
+    actionUserUpdate, actionOrdersFind, getData, actionLogin } from "../../reducers";
 import {createStore, combineReducers, applyMiddleware, bindActionCreators} from 'redux';
 import { connect } from "react-redux";
 import { useEffect, useState, useRef } from "react";
 
 import {BrowserRouter as Router, Route, Link, Switch, Redirect, useHistory} from 'react-router-dom';
-import { NewAuth } from "../reducers/actionAuthLog";
+import { NewAuth } from "../../actions/actionAuthLog";
 
 
 const YourProfile = ({state, orders, loginStatus = {}, updateStatus, updatedUser = {}, newImg, token, onLogin, onLogout, updateImg, 
@@ -91,7 +91,7 @@ const YourProfile = ({state, orders, loginStatus = {}, updateStatus, updatedUser
                     
                     { (isOwner.id == data._id) ? <h2>Привіт, {data.nick || "людино"}!</h2> : <h2>{data.nick || data.login}</h2>}
 
-                    <img src={data.avatar ? `${urlUpload}/${data.avatar.url}`: 'https://pngicon.ru/file/uploads/picca-1.png'} />
+                    <img src={data.avatar ? `${urlUpload}/${data.avatar.url}`: '/pizza_profile.png'} />
                     <span>
                         Сторінку створено {`${date.getDate()}. ${date.getMonth() + 1}. ${date.getFullYear()} о ${date.getHours()}: ${date.getMinutes()}: ${date.getSeconds()}  `}
                     </span>

+ 3 - 4
shop/src/components/usersList.js

@@ -1,7 +1,7 @@
 import { connect } from "react-redux";
-import { actionSearchUser, urlUpload } from "../reducers";
+import { actionSearchUser, urlUpload } from "../../reducers";
 import { useEffect, useState, useRef } from "react";
-import {SearchUserInput} from "./index";
+import {SearchUserInput} from "../index";
 import {BrowserRouter as Router, Route, Link, Switch, Redirect, useHistory} from 'react-router-dom';
 import {createStore, combineReducers, applyMiddleware, bindActionCreators} from 'redux';
 
@@ -34,7 +34,6 @@ const OneUserIcon = ({nick, img, login, id, isUserAdm}) => {
 
 const UsersList = ({match:{params:{users}}, state, getData, usersList}) => {
     useEffect(() =>  getData(`${users}`),[users]);
-    console.log(state)
     if(usersList) {
     return(
         <>
@@ -44,7 +43,7 @@ const UsersList = ({match:{params:{users}}, state, getData, usersList}) => {
             <div className = "usersList">
                 {usersList.map((user) => 
                     
-                    <OneUserIcon key = {user._id} isUserAdm = {user.acl.indexOf("admin") > -1} id = {user._id }nick = {user.nick} login = {user.login} img = {user.avatar ? (`${urlUpload}/${user.avatar.url}`) : ('https://pngicon.ru/file/uploads/picca-1.png')}/>
+                    <OneUserIcon key = {user._id} isUserAdm = {user.acl.indexOf("admin") > -1} id = {user._id }nick = {user.nick} login = {user.login} img = {user.avatar ? (`${urlUpload}/${user.avatar.url}`) : ('/pizza_profile.png')}/>
                 )}
             </div>
         

shop/src/reducers/history.js → shop/src/history.js


+ 18 - 18
shop/src/reducers/index.js

@@ -1,27 +1,27 @@
 import {createStore, combineReducers, applyMiddleware, compose} from 'redux';
 import thunk from 'redux-thunk';
-import actionPromise from "./actionPromise";
-import {gql, urlUpload} from "./gql";
-import actionGoods from "./actionGoods"
-import getData from "./getData";
-import {actionSearch} from "./actionsearch";
-import actionLogin from "./actionLogin";
+import actionPromise from "../actions/actionPromise";
+import {gql, urlUpload} from "../actions/gql";
+import actionGoods from "../actions/actionGoods"
+import getData from "../actions/getData";
+import {actionSearch} from "../actions/actionsearch";
+import actionLogin from "../actions/actionLogin";
 import authReducer from "./authReducer";
-import {actionAuthLogin, actionAuthLogout} from "./actionAuthLog";
-import actionGoodCard from "./actionGoodCard";
-import updateImgAction from "./actionUpdateImg";
+import {actionAuthLogin, actionAuthLogout} from "../actions/actionAuthLog";
+import actionGoodCard from "../actions/actionGoodCard";
+import updateImgAction from "../actions/actionUpdateImg";
 import {cartReducer, actionCartClear, actionCartDelete, actionCartAdd} from "./cartReducer";
-import actionOrder from "./actionOrder";
-import actionReg from "./actionReg";
-import actionUserFindOne from "./actionFindOneUser";
-import actionUserUpdate from "./actionUserUpdate";
-import actionSearchUser from "./actionSearchUser";
-import actionGoodUpdate from "./actionGoodUpdate";
+import actionOrder from "../actions/actionOrder";
+import actionReg from "../actions/actionReg";
+import actionUserFindOne from "../actions/actionFindOneUser";
+import actionUserUpdate from "../actions/actionUserUpdate";
+import actionSearchUser from "../actions/actionSearchUser";
+import actionGoodUpdate from "../actions/actionGoodUpdate";
 import {orderUpdateReducer, actionOrderClear, actionOrderAddNewGood, actionOrderAddOne, actionOrderAddOrder, actionOrderDelete} from "./orderUpdateReduser"
-import {actionOrdersFind, actionOrderFindOne} from "./actionOrdersFind";
-import actionOrderUpdate from "./actionUpdateOrder";
+import {actionOrdersFind, actionOrderFindOne} from "../actions/actionOrdersFind";
+import actionOrderUpdate from "../actions/actionUpdateOrder";
 import {wishListReducer, actionWishAdd, actionWishDelete} from "./wishListReducer";
-import actionWishes from "./actionWishSearch";
+import actionWishes from "../actions/actionWishSearch";
 
 
 function promiseReducer(state={}, action){