浏览代码

fix path resolver

amenpunk 2 年之前
父节点
当前提交
c9e5f7340c
共有 2 个文件被更改,包括 17 次插入13 次删除
  1. 1 1
      src/Components/Dashboard.js
  2. 16 12
      src/Components/Navigation/listItems.js

+ 1 - 1
src/Components/Dashboard.js

@@ -22,7 +22,7 @@ import Footer from "../Components/Footer";
22 22
 
23 23
 import { Drawer as MuiDrawer, AppBar as MuiAppBar } from "../Components/Navigation/AppBar"
24 24
 import { MainListItems, SecondaryListItems } from '../Components/Navigation/listItems';
25
-import ProfilePicture from '../Images/man.png';
25
+// import ProfilePicture from '../Images/man.png';
26 26
 import { useDispatch, useSelector } from 'react-redux';
27 27
 import { removeToken } from '../Slices/tokenSlice';
28 28
 

+ 16 - 12
src/Components/Navigation/listItems.js

@@ -1,13 +1,17 @@
1 1
 import * as React from 'react';
2 2
 import { Nav } from 'react-bootstrap';
3 3
 
4
-import { Fingerprint, ExpandLess, ExpandMore } from '@mui/icons-material/'
4
+// import { Fingerprint, ExpandLess, ExpandMore } from '@mui/icons-material/'
5 5
 import { useNavigate, useResolvedPath, useMatch } from 'react-router-dom'
6
-import { Collapse, ListItem, List, ListItemIcon, ListItemText, ListSubheader } from '@mui/material/'
6
+import { 
7
+  ListItem, List, ListItemIcon, ListItemText, ListSubheader 
8
+  // Collapse,
9
+} from '@mui/material/'
7 10
 
8 11
 import {
9
-  MainItems, ExtraItems, PruebaItems, TxTStyle,
10
-  UserItems
12
+  MainItems, ExtraItems, TxTStyle,
13
+  UserItems,
14
+ // PruebaItems
11 15
 } from '../../Utils/MenuItems'
12 16
 
13 17
 
@@ -15,7 +19,7 @@ function NavItem(props) {
15 19
 
16 20
   let navigate = useNavigate()
17 21
   let resolved = useResolvedPath(props.route);
18
-  let match = useMatch({ path: resolved.pathname, end: true });
22
+  let match = useMatch({ path: resolved.pathname, end: false });
19 23
 
20 24
   let { title, route, icon, open, AppBarVisible, setOpen } = props
21 25
 
@@ -43,14 +47,14 @@ function NavItem(props) {
43 47
 
44 48
 export const MainListItems = (props) => {
45 49
 
46
-  const [open, setOpen] = React.useState(false);
50
+  // const [open, setOpen] = React.useState(false);
47 51
 
48
-  const showPruebas = () => {
49
-    if (!props.AppBarVisible) {
50
-      props.setAppBarVisible(true);
51
-    }
52
-    setOpen(!open);
53
-  };
52
+  // const showPruebas = () => {
53
+  //   if (!props.AppBarVisible) {
54
+  //     props.setAppBarVisible(true);
55
+  //   }
56
+  //   setOpen(!open);
57
+  // };
54 58
 
55 59
   return (
56 60
     <List>