|
@@ -2,7 +2,6 @@ import {Footer, Links} from "./index"
|
|
import {BrowserRouter as Router, Route, Link, Switch, Redirect, useHistory} from 'react-router-dom';
|
|
import {BrowserRouter as Router, Route, Link, Switch, Redirect, useHistory} from 'react-router-dom';
|
|
import {Provider, connect} from 'react-redux';
|
|
import {Provider, connect} from 'react-redux';
|
|
import React, {Component, useState, useEffect} from 'react';
|
|
import React, {Component, useState, useEffect} from 'react';
|
|
-// import createHistory from "history/createBrowserHistory";
|
|
|
|
import {actionAuthLogout, actionUserFindOne} from "../reducers"
|
|
import {actionAuthLogout, actionUserFindOne} from "../reducers"
|
|
import {createStore, combineReducers, applyMiddleware} from 'redux';
|
|
import {createStore, combineReducers, applyMiddleware} from 'redux';
|
|
import thunk from 'redux-thunk';
|
|
import thunk from 'redux-thunk';
|
|
@@ -21,7 +20,6 @@ const StandartMenu = ({className = "standartMenu", getCat = null}) => {
|
|
|
|
|
|
<Links url = {"/catalog"} text = {"Каталог"}/>
|
|
<Links url = {"/catalog"} text = {"Каталог"}/>
|
|
<Links url = {"/about"} text = {"Про нас"}/>
|
|
<Links url = {"/about"} text = {"Про нас"}/>
|
|
- {/* <Links url = {"/post"} text = {"Оплата і доставка"}/> */}
|
|
|
|
<Links url = {"/contacts"} text = {"Контакти"}></Links>
|
|
<Links url = {"/contacts"} text = {"Контакти"}></Links>
|
|
|
|
|
|
</ul>
|
|
</ul>
|
|
@@ -51,7 +49,7 @@ const TabletMenu = ({}) => {
|
|
}
|
|
}
|
|
|
|
|
|
const ToLoginPage = ({login, onLogout, getData, NickName = "User", loginId}) => {
|
|
const ToLoginPage = ({login, onLogout, getData, NickName = "User", loginId}) => {
|
|
- // useEffect(() => login && getData(loginId),[login])
|
|
|
|
|
|
+
|
|
const history = useHistory();
|
|
const history = useHistory();
|
|
|
|
|
|
|
|
|
|
@@ -63,8 +61,10 @@ const ToLoginPage = ({login, onLogout, getData, NickName = "User", loginId}) =>
|
|
</svg>
|
|
</svg>
|
|
<Link to = {login ? "/profile/": "/login"} >
|
|
<Link to = {login ? "/profile/": "/login"} >
|
|
<span className = "link">{login ? login : "Вхід"}</span>
|
|
<span className = "link">{login ? login : "Вхід"}</span>
|
|
- {login && <button onClick = {() => onLogout()}>Вихід</button>}
|
|
|
|
- </Link>
|
|
|
|
|
|
+ </Link>
|
|
|
|
+ {login && <button onClick = {() => { onLogout()
|
|
|
|
+ window.location.reload()}}>Вихід</button>}
|
|
|
|
+
|
|
</>
|
|
</>
|
|
)
|
|
)
|
|
}
|
|
}
|
|
@@ -117,8 +117,6 @@ const CBasket = connect(s => ({data: s.basket, basketCount: s.basket.price}), {}
|
|
|
|
|
|
const Header = ({}) => {
|
|
const Header = ({}) => {
|
|
|
|
|
|
- // const [wishes, wishesCount] = useState(0);
|
|
|
|
- // console.log(connect((s) => ({isLoggedIn: s.auth.payload})))
|
|
|
|
return(
|
|
return(
|
|
<>
|
|
<>
|
|
<div className = "header">
|
|
<div className = "header">
|
|
@@ -130,12 +128,6 @@ const Header = ({}) => {
|
|
|
|
|
|
<div className = "rightSide">
|
|
<div className = "rightSide">
|
|
<CWishes/>
|
|
<CWishes/>
|
|
- {/* <div>
|
|
|
|
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" className="bi bi-heart" viewBox="0 0 16 16">
|
|
|
|
- <path d="M8 2.748l-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"/>
|
|
|
|
- </svg>
|
|
|
|
- <span>Хочу({wishes})</span>
|
|
|
|
- </div> */}
|
|
|
|
<div>
|
|
<div>
|
|
<CToLoginPage/>
|
|
<CToLoginPage/>
|
|
|
|
|