import React from 'react'; import {connect} from 'react-redux'; import {Switch} from "react-router-dom"; import {getDoctors} from "./actions/actions"; import {getServices, getCategories} from "./actions/services"; import {getUser} from "./actions/auth" import Loader from "./components/hooks/loader"; import Header from "./components/header/index"; import Footer from "./components/Footer"; import {route} from './utils/formFields' import { PrivateRoute } from "./privateRouter"; export class App extends React.Component { componentDidMount() { this.props.getDoctors(); this.props.getServices(); console.log(this.props.app) this.props.getCategories(); if(localStorage.getItem('userId')) this.props.getUser() // fetch ("https://api-clinics.herokuapp.com/api/v1/auth/login", { // method : "POST", // credentials: "include", // headers: { // "Content-Type": "application/json" // }, // body: JSON.stringify ({ // email: "test@test.com", // password: "qwerty" // }) // }) // .then (res => res.json ()) // .then (res => console.log (res)) } render() { return (
{route.map(el => ( ))}