@@ -2,7 +2,7 @@ import React from 'react';
2
2
import { useSelector , connect } from 'react-redux' ;
3
3
import Header from '../../components/Header' ;
4
4
import SidebarNav from 'components/SidebarNav' ;
5
- import { match , Route } from 'react-router-dom' ;
5
+ import { Route } from 'react-router-dom' ;
6
6
import Introduction from './Introduction' ;
7
7
import Posts from './Posts/Posts' ;
8
8
import Edit from './Post/Edit/Edit' ;
@@ -13,27 +13,25 @@ import { AppState } from 'reducers';
13
13
import { unAuthUser } from 'actions' ;
14
14
15
15
type AdminProps = {
16
- match : match ;
17
16
location : Location ;
18
17
unAuthUser : ( ) => void ;
19
18
} ;
20
19
21
- const Admin : React . FC < AdminProps > = ( { match , location, unAuthUser } ) => {
20
+ const Admin : React . FC < AdminProps > = ( { location, unAuthUser } ) => {
22
21
const currentUser = useSelector ( ( state : AppState ) => state . wp . currentUser ) ;
23
22
24
- const { path : basePath } = match ;
25
23
const { pathname } = location ;
26
24
return (
27
25
< div className = 'dashboard' >
28
26
< Header currentUser = { currentUser } unAuthUser = { unAuthUser } />
29
27
< div className = 'admin-content' >
30
- < SidebarNav basePath = { basePath } pathName = { pathname } />
28
+ < SidebarNav basePath = '/' pathName = { pathname } />
31
29
< div className = 'container-fluid' >
32
- < Route path = { basePath } exact component = { Introduction } />
33
- < Route path = { ` ${ basePath } posts` } component = { Posts } />
34
- < Route path = { ` ${ basePath } post/edit/:id` } component = { Edit } />
35
- < Route path = { ` ${ basePath } add-new` } component = { AddNew } />
36
- < Route path = { ` ${ basePath } account` } component = { AccountInfo } />
30
+ < Route path = '/' exact component = { Introduction } />
31
+ < Route path = '/ posts' component = { Posts } />
32
+ < Route path = '/ post/edit/:id' component = { Edit } />
33
+ < Route path = '/ add-new' component = { AddNew } />
34
+ < Route path = '/ account' component = { AccountInfo } />
37
35
</ div >
38
36
</ div >
39
37
</ div >
0 commit comments