|
@@ -1,8 +1,8 @@
|
|
|
-import React, {useState, useEffect } from "react";
|
|
|
-import { Switch, Route, withRouter } from "react-router-dom";
|
|
|
+import React, {useEffect } from "react";
|
|
|
+import { Switch, withRouter } from "react-router-dom";
|
|
|
import { connect } from "react-redux";
|
|
|
|
|
|
-import { getAllEvents } from "./actions/getAllEvents";
|
|
|
+//import { getAllEvents } from "./actions/getAllEvents";
|
|
|
|
|
|
import AdminMainPage from './conteiners/adminMainPage/adminMainPage';
|
|
|
import AdminAddEventPage from './conteiners/adminAddEventPage/adminAddEventPage';
|
|
@@ -39,44 +39,51 @@ const route = [
|
|
|
path: "/events",
|
|
|
protected: false,
|
|
|
component: Events
|
|
|
- },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 3,
|
|
|
+ exact: true,
|
|
|
+ path: "/events:id",
|
|
|
+ protected: false,
|
|
|
+ component: EventCard
|
|
|
+ },
|
|
|
{
|
|
|
- id: 3,
|
|
|
+ id: 4,
|
|
|
exact: true,
|
|
|
path: "/result",
|
|
|
protected: true,
|
|
|
component: Result
|
|
|
},
|
|
|
{
|
|
|
- id: 4,
|
|
|
+ id: 5,
|
|
|
exact: true,
|
|
|
path: "/gallery",
|
|
|
protected: false,
|
|
|
component: Gallery
|
|
|
},
|
|
|
{
|
|
|
- id: 5,
|
|
|
+ id: 6,
|
|
|
exact: true,
|
|
|
path: "/reviews",
|
|
|
protected: false,
|
|
|
component: Reviews
|
|
|
},
|
|
|
{
|
|
|
- id: 6,
|
|
|
+ id: 7,
|
|
|
exact: true,
|
|
|
path: "/login",
|
|
|
protected: false,
|
|
|
component: Login
|
|
|
},
|
|
|
{
|
|
|
- id: 7,
|
|
|
+ id: 8,
|
|
|
exact: true,
|
|
|
path: "/registration",
|
|
|
protected: false,
|
|
|
component: RegistrationPage
|
|
|
},
|
|
|
{
|
|
|
- id: 8,
|
|
|
+ id: 9,
|
|
|
exact: true,
|
|
|
path: "/profile",
|
|
|
protected: true,
|
|
@@ -84,7 +91,7 @@ const route = [
|
|
|
component: Profile
|
|
|
},
|
|
|
{
|
|
|
- id: 9,
|
|
|
+ id: 10,
|
|
|
exact: true,
|
|
|
path: "/admin",
|
|
|
protected: true,
|
|
@@ -92,7 +99,7 @@ const route = [
|
|
|
component: AdminMainPage
|
|
|
},
|
|
|
{
|
|
|
- id: 10,
|
|
|
+ id: 11,
|
|
|
exact: true,
|
|
|
path: "/admin/add_new_event",
|
|
|
protected: true,
|
|
@@ -100,7 +107,7 @@ const route = [
|
|
|
component: AdminAddEventPage
|
|
|
},
|
|
|
{
|
|
|
- id: 11,
|
|
|
+ id: 12,
|
|
|
exact: true,
|
|
|
path: "/admin/photogalary",
|
|
|
protected: true,
|
|
@@ -108,7 +115,7 @@ const route = [
|
|
|
component: AdminAddPhotogalarytPage
|
|
|
},
|
|
|
{
|
|
|
- id: 12,
|
|
|
+ id: 13,
|
|
|
exact: true,
|
|
|
path: "/admin/my_events",
|
|
|
protected: true,
|
|
@@ -116,7 +123,7 @@ const route = [
|
|
|
component: AdminMyEventsPage
|
|
|
},
|
|
|
{
|
|
|
- id: 4,
|
|
|
+ id: 14,
|
|
|
component: PAGENOTFOUND
|
|
|
}
|
|
|
];
|
|
@@ -136,7 +143,7 @@ const Router = withRouter(({ history, user }) => {
|
|
|
}
|
|
|
}, [user]);
|
|
|
|
|
|
- console.log('user', user)
|
|
|
+ //console.log('user', user)
|
|
|
|
|
|
return (
|
|
|
<div className="container">
|
|
@@ -151,7 +158,7 @@ const Router = withRouter(({ history, user }) => {
|
|
|
component={el.component}
|
|
|
// events = {el.events && events}
|
|
|
/>
|
|
|
- ))}
|
|
|
+ ))}
|
|
|
|
|
|
{/* {
|
|
|
events.map(event =>
|
|
@@ -168,7 +175,7 @@ const Router = withRouter(({ history, user }) => {
|
|
|
});
|
|
|
|
|
|
const mapStateToProps = state => {
|
|
|
- console.log('state',state)
|
|
|
+ //console.log('state',state)
|
|
|
return {
|
|
|
// events: state.getEvents.events,
|
|
|
user: state.login.user
|