|
@@ -1,56 +1,22 @@
|
|
|
import {BrowserRouter as Router, Route, Link, Switch, Redirect} from 'react-router-dom';
|
|
|
import createHistory from "history/createBrowserHistory";
|
|
|
-import About from "./about"
|
|
|
-import {Footer, catalogCard} from "./index"
|
|
|
+import {actionCatalogCard} from "./index"
|
|
|
import { useState } from 'react';
|
|
|
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"
|
|
|
|
|
|
-const gql = "http://shop-roles.asmer.fs.a-level.com.ua/graphql";
|
|
|
+//import BigCatalog2 from "./bigCat"
|
|
|
|
|
|
|
|
|
|
|
|
-const getGQL = url => (query, variables = {}) =>
|
|
|
- fetch(url, {
|
|
|
- method: 'POST',
|
|
|
- headers: {
|
|
|
- 'Accept': 'application/json',
|
|
|
- 'Content-Type': 'application/json',
|
|
|
- ...(localStorage.authToken ? {Authorization: `Bearer ${localStorage.authToken}`} : {})
|
|
|
- },
|
|
|
- body: JSON.stringify({query, variables})
|
|
|
- }).then(res => res.json())
|
|
|
|
|
|
-
|
|
|
-const Li = ({name}) => {
|
|
|
- return(
|
|
|
- <li>{name}</li>
|
|
|
- )
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-const Catalog = ({getCat = () => console.log("no today")}) => {
|
|
|
-
|
|
|
-
|
|
|
- return(
|
|
|
- <>
|
|
|
- <ul className = "catalog">
|
|
|
- Работаю
|
|
|
- </ul>
|
|
|
- <button onClick={() => { if (!getCat){
|
|
|
- debugger
|
|
|
- }
|
|
|
- console.log(getCat)
|
|
|
- getCat()}}>mazafaca</button>
|
|
|
- </>
|
|
|
-)}
|
|
|
-
|
|
|
-const BigCatalog = connect(() => ({}), { getCat: catalogCard })(Catalog);
|
|
|
-
|
|
|
-const MainImg = ({className = "MainImg"}) => {
|
|
|
+
|
|
|
+const BigCatalog = connect(() => ({}), { getData: actionCatalogCard })(Catalog);
|
|
|
+
|
|
|
+ const MainImg = ({className = "MainImg" }) => {
|
|
|
return (
|
|
|
<div className = {className}>
|
|
|
<aside></aside>
|
|
@@ -58,7 +24,7 @@ const MainImg = ({className = "MainImg"}) => {
|
|
|
<Switch>
|
|
|
<Route path = "/" component = {Main} exact/>
|
|
|
<Route path = "/catalog" component={BigCatalog}/>
|
|
|
- <Route path="/about" component = {About}/>
|
|
|
+ {/* <Route path="/about" component = {About}/> */}
|
|
|
<Route path = "/post" component = {Post}/>
|
|
|
<Route path = "/contacts" component = {Contacts}/>
|
|
|
<Route component = { NotFound } exact/>
|
|
@@ -66,12 +32,19 @@ const MainImg = ({className = "MainImg"}) => {
|
|
|
</content>
|
|
|
</div>
|
|
|
)
|
|
|
-}
|
|
|
-const Main = () => <div>Я тут кароче самый главный страниц</div>
|
|
|
-const NotFound = () => <div>Да пошел ты!</div>
|
|
|
+ }
|
|
|
+
|
|
|
+ const Main = () => <div>Я тут кароче самый главный страниц</div>
|
|
|
+ const NotFound = () => <div>Да пошел ты!</div>
|
|
|
+
|
|
|
+ const Post = () => <div className = "post">Точно не знаю зачем это, возможно потом уберу. Но в некоторых магазинах есть такое</div>
|
|
|
+ const Contacts = () => <div className = "contacts">Тут будет адрес, номер телефона и соцсети</div>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-const Post = () => <div className = "post">Точно не знаю зачем это, возможно потом уберу. Но в некоторых магазинах есть такое</div>
|
|
|
-const Contacts = () => <div className = "contacts">Тут будет адрес, номер телефона и соцсети</div>
|
|
|
|
|
|
|
|
|
|