import './App.scss';
import {Provider, connect} from 'react-redux';
import {createStore, combineReducers, applyMiddleware} from 'redux';
import thunk from 'redux-thunk';
import {useEffect, useState, useRef} from "react";
import React, {useCallback} from 'react';
import {Router, Route, Link, Redirect, Switch} from 'react-router-dom';
import createHistory from "history/createBrowserHistory";
import {store} from "./reducers/store";
import Routes from "./components/routes";
import 'bootstrap/dist/css/bootstrap.min.css';

//import {useDropzone} from 'react-dropzone'
/*const actionAboutMe = () => {
	async(dispatch, getState)=>{
		
	}
}
const actioUploadFile = file =>{
	return actionPromise('uploadFile', fetch().then(res=>res.json))
}
const actionSetAvatar = file =>{
	async(dispatch, getState) => {
		
	}
}*/
//const store = createStore(combineReducers({promise: promiseReducer, auth: authReducer}),applyMiddleware(thunk))
//store.subscribe(()=>console.log(store.getState()))
//store.dispatch(actionCatById('5dc49f4d5df9d670df48cc64'))
//store.dispatch(actionFullLogin('vladBraun4','123'))

const history = createHistory();

function App() {
  	return (
  		<Router history={history}>
  			<Provider store={store} >
	      		<Routes />
	    	</Provider>
	    </Router>
  	);
}

export default App;


