Browse Source

fix path resolver

amenpunk 2 years ago
parent
commit
c9e5f7340c
2 changed files with 17 additions and 13 deletions
  1. 1 1
      src/Components/Dashboard.js
  2. 16 12
      src/Components/Navigation/listItems.js

+ 1 - 1
src/Components/Dashboard.js

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

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

1
 import * as React from 'react';
1
 import * as React from 'react';
2
 import { Nav } from 'react-bootstrap';
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
 import { useNavigate, useResolvedPath, useMatch } from 'react-router-dom'
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
 import {
11
 import {
9
-  MainItems, ExtraItems, PruebaItems, TxTStyle,
10
-  UserItems
12
+  MainItems, ExtraItems, TxTStyle,
13
+  UserItems,
14
+ // PruebaItems
11
 } from '../../Utils/MenuItems'
15
 } from '../../Utils/MenuItems'
12
 
16
 
13
 
17
 
15
 
19
 
16
   let navigate = useNavigate()
20
   let navigate = useNavigate()
17
   let resolved = useResolvedPath(props.route);
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
   let { title, route, icon, open, AppBarVisible, setOpen } = props
24
   let { title, route, icon, open, AppBarVisible, setOpen } = props
21
 
25
 
43
 
47
 
44
 export const MainListItems = (props) => {
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
   return (
59
   return (
56
     <List>
60
     <List>