amenpunk 3 年 前
コミット
f04f8ab253

+ 1 - 1
psicoadmin/public/index.html

@@ -13,7 +13,7 @@
13 13
     <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
14 14
     <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
15 15
 
16
-    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
16
+    <!-- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" /> -->
17 17
     <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
18 18
     <!--
19 19
       manifest.json provides metadata used when your web app is installed on a

+ 13 - 0
psicoadmin/src/App.css

@@ -36,3 +36,16 @@
36 36
     transform: rotate(360deg);
37 37
   }
38 38
 }
39
+
40
+.Mui-selected{
41
+    color : #FFF !important;
42
+    background-color : #fd4b4b !important;
43
+}
44
+
45
+.Mui-selected > .MuiListItemIcon-root{
46
+    color : #FFF !important;
47
+}
48
+
49
+.MuiBadge-badge{
50
+    background-color : #fd4b4b !important;
51
+}

+ 1 - 2
psicoadmin/src/Auth/AuthProvider.js

@@ -12,7 +12,7 @@ export function AuthProvider ({ children }){
12 12
             localStorage.setItem('user', user)
13 13
             setUser(user)
14 14
         },
15
-        logout : () =>{
15
+        logout : () => {
16 16
             setUser(null)
17 17
             localStorage.setItem('user', JSON.stringify({ }) )
18 18
         },
@@ -20,7 +20,6 @@ export function AuthProvider ({ children }){
20 20
             if(!user) return false
21 21
             let current = JSON.parse(user)
22 22
             let keys = Object.keys(current)
23
-            console.log("CURRENT -> ",current, 'KEY LEN -> ', keys.length)
24 23
             return  keys.length > 0
25 24
         }
26 25
     }

+ 18 - 7
psicoadmin/src/Components/Dashboard.js

@@ -16,7 +16,7 @@ import Avatar from '@mui/material/Avatar';
16 16
 import MenuIcon from '@mui/icons-material/Menu';
17 17
 import ChevronLeftIcon from '@mui/icons-material/ChevronLeft';
18 18
 import NotificationsIcon from '@mui/icons-material/Notifications';
19
-import { mainListItems, secondaryListItems } from './listItems';
19
+import { MainListItems, secondaryListItems } from './listItems';
20 20
 
21 21
 import Menu from '@mui/material/Menu';
22 22
 import MenuItem from '@mui/material/MenuItem';
@@ -110,11 +110,7 @@ function DashboardContent() {
110 110
                         </IconButton>
111 111
 
112 112
                         <Typography component="h1" variant="h6" color="inherit" noWrap sx={{ flexGrow: 1 }} >
113
-                            <div className="sidebar-header">
114
-                                <div className="width_img">
115
-                                    <img src={Logo} alt=""/>
116
-                                </div>
117
-                            </div>
113
+                           revelation come
118 114
                         </Typography>
119 115
 
120 116
 
@@ -175,13 +171,28 @@ function DashboardContent() {
175 171
                             alignItems: 'center',
176 172
                             justifyContent: 'flex-end',
177 173
                             px: [1],
174
+                            
178 175
                         }} >
176
+
177
+                            <div className="sidebar-header">
178
+                                <div className="width_img">
179
+                                    <img src={Logo} alt=""/>
180
+                                </div>
181
+                            </div>
182
+
183
+
179 184
                         <IconButton onClick={toggleDrawer}>
180 185
                             <ChevronLeftIcon />
181 186
                         </IconButton>
187
+
188
+
189
+
190
+
182 191
                     </Toolbar>
183 192
                     <Divider />
184
-                    <List>{mainListItems}</List>
193
+                    <List>
194
+                        <MainListItems/>
195
+                    </List>
185 196
                     <Divider />
186 197
                     <List>{secondaryListItems}</List>
187 198
                 </Drawer>

+ 39 - 0
psicoadmin/src/Components/NavStyle.js

@@ -0,0 +1,39 @@
1
+import Color from 'color';
2
+
3
+export default () => ({
4
+    root: ({ collapsed }) => ({
5
+        borderTopRightRadius: 20,
6
+        borderBottomRightRadius: 20,
7
+        minHeight: 32,
8
+        '-webkit-font-smoothing': 'antialiased',
9
+        padding: collapsed ? '0px 6px' : '0 12px 0 26px',
10
+        width: collapsed ? 32 : 'auto',
11
+        borderRadius: collapsed ? 20 : 0,
12
+        overflow: collapsed ? 'hidden' : 'visible',
13
+        marginLeft: collapsed ? 20 : '',
14
+        fontSize: 14,
15
+        '& > svg:first-child': {
16
+            marginRight: 18,
17
+            fontSize: 20,
18
+            opacity: 0.54,
19
+        },
20
+        '& .MuiLabel-amount': {
21
+            fontSize: '0.75rem',
22
+            letterSpacing: 0.3,
23
+            marginLeft: 'auto',
24
+            paddingLeft: 16,
25
+        },
26
+    }),
27
+    selected: ({ color = '#202124' }) => ({
28
+        fontWeight: 'bold',
29
+        color,
30
+        backgroundColor: `${Color(color)
31
+      .saturate(0.5)
32
+      .lighten(0.9)
33
+      .toString()} !important`,
34
+        '& > svg:first-child': {
35
+            opacity: 1,
36
+        }
37
+    }),
38
+});
39
+

+ 61 - 23
psicoadmin/src/Components/listItems.js

@@ -1,11 +1,13 @@
1 1
 import * as React from 'react';
2
+import ListItemButton from '@mui/material/ListItemButton';
2 3
 import ListItem from '@mui/material/ListItem';
4
+import List from '@mui/material/List';
5
+
3 6
 import ListItemIcon from '@mui/material/ListItemIcon';
4 7
 import ListItemText from '@mui/material/ListItemText';
5 8
 import ListSubheader from '@mui/material/ListSubheader';
6 9
 
7 10
 import { Nav } from 'react-bootstrap';
8
-import { NavLink } from 'react-router-dom'
9 11
 
10 12
 import HomeIcon from '@mui/icons-material/Home'
11 13
 import WorkIcon from '@mui/icons-material/Work';
@@ -21,42 +23,78 @@ import OndemandVideoIcon from '@mui/icons-material/OndemandVideo';
21 23
 import StarIcon from '@mui/icons-material/Star';
22 24
 import SupportAgentIcon from '@mui/icons-material/SupportAgent';
23 25
 
26
+import NavStyle from './NavStyle' 
27
+
28
+
24 29
 function Item (props) {
30
+
31
+
32
+    function change (event){
33
+        props.change(event, props.index)
34
+    } 
35
+    let isOn = props.selected === props.index
36
+
37
+    //.css-10oikv1-MuiButtonBase-root-MuiListItem-root.Mui-selected
25 38
     return(
26
-        <ListItem button>
39
+        <ListItem
40
+            sx={{
41
+                color : '#25344f',
42
+                '& .MuiButtonBase-selected' :{
43
+                    color : '#121212',
44
+                    backgroundColor : '#101010'
45
+                }
46
+            }}
47
+            selected={isOn}
48
+            onClick={change} 
49
+            button
50
+            >
27 51
             <ListItemIcon>
28 52
                 {props.icon}
29 53
             </ListItemIcon>
30
-            <Nav.Item>
31
-                <NavLink to={props.route}>
32
-                    <ListItemText primary={props.title} />
33
-                </NavLink>
34
-            </Nav.Item>
54
+            <ListItemText 
55
+                sx={{
56
+                    fontSize: 12,
57
+                    ' .css-10hburv-MuiTypography-root' : {
58
+                        fontSize : '.875rem'
59
+                    },
60
+                }}
61
+                primary={props.title} 
62
+            />
35 63
         </ListItem>
36 64
     )
37 65
 }
38 66
 
39 67
 
40
-export const mainListItems = (
41
-    <Nav>
42
-        <ListSubheader inset>MENÚ</ListSubheader>
43
-        <Item icon={<HomeIcon/>} title="Inicio" route="/home" />
44
-        <Item icon={<WorkIcon/>} title="Puestos" route="/work" />
45
-        <Item icon={<VisibilityOffIcon/>} title="Contraseñas" route="/work" />
46
-        <Item icon={<PeopleAltIcon/>} title="Expedientes" route="/work" />
47
-        <Item icon={<EqualizerIcon/>} title="Resultados" route="/work" />
48
-        <Item icon={<FingerprintIcon/>} title="Pruebas" route="/work" />
49
-        <Item icon={<MiscellaneousServicesIcon/>} title="Configuraciones" route="/work" />
50
-        <Item icon={<HistoryIcon/>} title="Historial" route="/work" />
68
+export const MainListItems = () =>  {
69
+    
70
+    const [selectedIndex, setSelectedIndex] = React.useState(1);
51 71
 
52
-    </Nav>
53
-);
72
+
73
+    const handleListItemClick = (event, index) => {
74
+        setSelectedIndex(index);
75
+    };
76
+
77
+
78
+    return(
79
+        <List>
80
+            <ListSubheader inset>MENÚ</ListSubheader>
81
+            <Item icon={<HomeIcon/>} index={0} selected={selectedIndex} change={handleListItemClick} title="Inicio" route="/dashboard" />
82
+            <Item icon={<WorkIcon/>} index={1} selected={selectedIndex} change={handleListItemClick} title="Puestos" route="/puestos" />
83
+            <Item icon={<VisibilityOffIcon/>} selected={selectedIndex}  change={handleListItemClick} index={2} title="Contraseñas" route="/contrasenas" />
84
+            <Item icon={<PeopleAltIcon/>} selected={selectedIndex}  change={handleListItemClick} index={3} title="Expedientes" route="/expedientes" />
85
+            <Item icon={<EqualizerIcon/>} selected={selectedIndex}  change={handleListItemClick} index={4} title="Resultados" route="/resultados" />
86
+            <Item icon={<FingerprintIcon/>} selected={selectedIndex}  change={handleListItemClick} index={5} title="Pruebas" route="/pruebas" />
87
+            <Item icon={<MiscellaneousServicesIcon/>} selected={selectedIndex}  change={handleListItemClick} index={6} title="Configuraciones" route="/configuraciones" />
88
+            <Item icon={<HistoryIcon/>} selected={selectedIndex}  change={handleListItemClick} index={7} title="Historial" route="/historial" />
89
+        </List>
90
+    )
91
+};
54 92
 
55 93
 export const secondaryListItems = (
56 94
     <Nav>
57 95
         <ListSubheader inset>EXTRAS</ListSubheader>
58
-        <Item icon={<StarIcon/>} title="Elementos" route="/work" />
59
-        <Item icon={<OndemandVideoIcon/>} title="Tutoriales" route="/work" />
60
-        <Item icon={<SupportAgentIcon/>} title="Asistencia Técnica" route="/work" />
96
+        <Item selected={false} icon={<StarIcon/>} title="Elementos" route="/work" />
97
+        <Item selected={false} icon={<OndemandVideoIcon/>} title="Tutoriales" route="/work" />
98
+        <Item selected={false} icon={<SupportAgentIcon/>} title="Asistencia Técnica" route="/work" />
61 99
     </Nav>
62 100
 );

+ 2 - 6
psicoadmin/src/Css/all.css

@@ -1,7 +1,7 @@
1 1
 *{
2 2
     text-decoration: none !important;
3 3
     outline: 0 !important;
4
-
4
+    font-family: 'gudea' !important;
5 5
 }
6 6
 .row {
7 7
     margin: 0 !important;
@@ -16,17 +16,13 @@ body {
16 16
     max-width: 100%;
17 17
     position: relative;
18 18
     margin: 0 auto;
19
-    font-family: 'gudea';
19
+    font-family: 'gudea' !important;
20 20
     background: #f1f1f1;
21
-
22 21
 }
23 22
 .container-in {
24 23
     max-width: 1100px;
25 24
     margin: 0 auto;
26 25
 }
27
-/*
28
-DEMO STYLE
29
- */
30 26
 
31 27
 a,
32 28
 a:hover,

+ 5 - 0
psicoadmin/src/Pages/Configuracion.js

@@ -0,0 +1,5 @@
1
+export default function Configuracion() {
2
+    return (
3
+        <h1>Configuraciones</h1>
4
+    )
5
+}

+ 5 - 0
psicoadmin/src/Pages/Contras.js

@@ -0,0 +1,5 @@
1
+export default function Contrasenas() {
2
+    return (
3
+        <h1>Passwords</h1>
4
+    )
5
+}

+ 5 - 0
psicoadmin/src/Pages/Expedientes.js

@@ -0,0 +1,5 @@
1
+export default function Expedientes() {
2
+    return (
3
+        <h1>Expedientes</h1>
4
+    )
5
+}

+ 5 - 0
psicoadmin/src/Pages/Historial.js

@@ -0,0 +1,5 @@
1
+export default function Historial() {
2
+    return (
3
+        <h1>Historial</h1>
4
+    )
5
+}

+ 5 - 0
psicoadmin/src/Pages/Home.js

@@ -0,0 +1,5 @@
1
+export default function Home() {
2
+    return (
3
+        <h1>Bienvenido</h1>
4
+    )
5
+}

+ 5 - 0
psicoadmin/src/Pages/Pruebas.js

@@ -0,0 +1,5 @@
1
+export default function Pruebas() {
2
+    return (
3
+        <h1>Pruebas</h1>
4
+    )
5
+}

+ 5 - 0
psicoadmin/src/Pages/Puestos.js

@@ -0,0 +1,5 @@
1
+export default function Puestos() {
2
+    return (
3
+        <h1>Puestos</h1>
4
+    )
5
+}

+ 5 - 0
psicoadmin/src/Pages/Resultados.js

@@ -0,0 +1,5 @@
1
+export default function Resultados() {
2
+    return (
3
+        <h1>Resultados</h1>
4
+    )
5
+}