|
@@ -1,8 +1,8 @@
|
|
|
-import React, { useState } from 'react';
|
|
|
import {Footer, Links} from "./index"
|
|
|
-import {BrowserRouter as Router, Route, Link, Switch, Redirect} from 'react-router-dom';
|
|
|
-import createHistory from "history/createBrowserHistory";
|
|
|
+import {BrowserRouter as Router, Route, Link, Switch, Redirect, useHistory} from 'react-router-dom';
|
|
|
import {Provider, connect} from 'react-redux';
|
|
|
+import React, {Component, useState, useEffect} from 'react';
|
|
|
+import createHistory from "history/createBrowserHistory";
|
|
|
import {actionAuthLogout} from "../reducers"
|
|
|
import {createStore, combineReducers, applyMiddleware} from 'redux';
|
|
|
import thunk from 'redux-thunk';
|
|
@@ -42,8 +42,8 @@ const TabletMenu = ({}) => {
|
|
|
return (
|
|
|
<>
|
|
|
|
|
|
- <svg onClick = {onClick} xmlns="http://www.w3.org/2000/svg" width="50" height="50" fill="currentColor" class="bi bi-justify-left" viewBox="0 0 16 16">
|
|
|
- <path fill-rule="evenodd" d="M2 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/>
|
|
|
+ <svg onClick = {onClick} xmlns="http://www.w3.org/2000/svg" width="50" height="50" fill="currentColor" className="bi bi-justify-left" viewBox="0 0 16 16">
|
|
|
+ <path fillRule="evenodd" d="M2 12.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5zm0-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/>
|
|
|
</svg>
|
|
|
{show && <StandartMenu className = {divStyle}/>}
|
|
|
</>
|
|
@@ -51,10 +51,11 @@ const TabletMenu = ({}) => {
|
|
|
}
|
|
|
|
|
|
const ToLoginPage = ({login, onLogout}) => {
|
|
|
-
|
|
|
+ const history = useHistory();
|
|
|
+ useEffect(() => login ? history.push(`/profile/` + login) : history.push(`/login`),[login])
|
|
|
return(
|
|
|
<>
|
|
|
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person" viewBox="0 0 16 16">
|
|
|
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" className="bi bi-person" viewBox="0 0 16 16">
|
|
|
<path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4zm-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10c-2.29 0-3.516.68-4.168 1.332-.678.678-.83 1.418-.832 1.664h10z"/>
|
|
|
</svg>
|
|
|
<Link to = {login ? "/profile/" + login: "/login"} >
|
|
@@ -82,7 +83,7 @@ const Header = ({}) => {
|
|
|
|
|
|
<div className = "rightSide">
|
|
|
<div>
|
|
|
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart" viewBox="0 0 16 16">
|
|
|
+ <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>
|
|
@@ -97,7 +98,7 @@ const Header = ({}) => {
|
|
|
</Link> */}
|
|
|
</div>
|
|
|
<div>
|
|
|
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-bag" viewBox="0 0 16 16">
|
|
|
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" className="bi bi-bag" viewBox="0 0 16 16">
|
|
|
<path d="M8 1a2.5 2.5 0 0 1 2.5 2.5V4h-5v-.5A2.5 2.5 0 0 1 8 1zm3.5 3v-.5a3.5 3.5 0 1 0-7 0V4H1v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4h-3.5zM2 5h12v9a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5z"/>
|
|
|
</svg>
|
|
|
<span>{basketCount}</span>
|