浏览代码

preview and store token

amenpunk 3 年之前
父节点
当前提交
6b1ce6dd20
共有 3 个文件被更改,包括 26 次插入15 次删除
  1. 17 0
      src/Components/Home/Candidato.jsx
  2. 8 14
      src/Components/Home/Candidatos.js
  3. 1 1
      src/Pages/Login.jsx

+ 17 - 0
src/Components/Home/Candidato.jsx

1
+import { Skeleton, Box } from '@mui/material';
1
 import React from 'react'
2
 import React from 'react'
3
+const big_as = 40
2
 
4
 
3
 export function Candidato (props) {
5
 export function Candidato (props) {
4
     let { password,puesto,DPI, aplicacion,pendientes } = props.user
6
     let { password,puesto,DPI, aplicacion,pendientes } = props.user
25
         </div>
27
         </div>
26
     )
28
     )
27
 }
29
 }
30
+
31
+export function Preview() {
32
+    return(
33
+        <Box sx={{ width: '100%' }}>
34
+            <Skeleton height={big_as} animation="wave" />
35
+            <Skeleton height={big_as} animation="wave" />
36
+            <Skeleton height={big_as} animation="wave" />
37
+            <Skeleton height={big_as} animation="wave" />
38
+            <Skeleton height={big_as} animation="wave" />
39
+            <Skeleton height={big_as} animation="wave" />
40
+            <Skeleton height={big_as} animation="wave" />
41
+            <Skeleton height={big_as} animation="wave" />
42
+        </Box>
43
+    )
44
+}

+ 8 - 14
src/Components/Home/Candidatos.js

3
 import UpdateIcon from '@mui/icons-material/Update';
3
 import UpdateIcon from '@mui/icons-material/Update';
4
 
4
 
5
 import {
5
 import {
6
-    Typography, Pagination, Stack, CircularProgress, Box
6
+    Typography, Pagination, Stack, 
7
+    // CircularProgress, Box
7
 } from '@mui/material'
8
 } from '@mui/material'
8
 
9
 
9
 import { Row, Col } from 'react-bootstrap';
10
 import { Row, Col } from 'react-bootstrap';
10
 
11
 
11
-import { Candidato } from './Candidato'
12
+import { Candidato, Preview } from './Candidato'
12
 // const USER_LENGTH = 14
13
 // const USER_LENGTH = 14
13
-const USER_LENGTH = 99
14
+const USER_LENGTH = 120
14
 
15
 
15
 
16
 
16
 function Divide(arregloOriginal){
17
 function Divide(arregloOriginal){
17
-    const LONGITUD_PEDAZOS = 10;
18
+    const LONGITUD_PEDAZOS = 6;
18
     let arregloDeArreglos = [];
19
     let arregloDeArreglos = [];
19
     for (let i = 0; i < arregloOriginal.length; i += LONGITUD_PEDAZOS) {
20
     for (let i = 0; i < arregloOriginal.length; i += LONGITUD_PEDAZOS) {
20
         let pedazo = arregloOriginal.slice(i, i + LONGITUD_PEDAZOS);
21
         let pedazo = arregloOriginal.slice(i, i + LONGITUD_PEDAZOS);
39
     useEffect(() => {
40
     useEffect(() => {
40
 
41
 
41
         setTimeout(() => {
42
         setTimeout(() => {
42
-
43
-
44
             let list =  [{
43
             let list =  [{
45
                 password : 'tester',
44
                 password : 'tester',
46
                 puesto : "Piloto Repartidor",
45
                 puesto : "Piloto Repartidor",
93
                     </Row>
92
                     </Row>
94
                 </div>
93
                 </div>
95
                 {
94
                 {
96
-                    users.length ?
97
-                    users[page - 1].map( user => (<Candidato key={user.DPI} user={user}/>)) 
98
-                    : 
99
-                        <center>
100
-                            <Box sx={{ display: 'flex', padding : '5%',  maginTop : 100,  }}> 
101
-                                <CircularProgress /> 
102
-                            </Box>
103
-                        </center>
95
+                    users.length 
96
+                    ? users[page - 1].map( user => (<Candidato key={user.DPI} user={user}/>)) 
97
+                    : <Preview lenght={10}/>
104
                 }
98
                 }
105
                 <Row style={{ padding : 5 }}>
99
                 <Row style={{ padding : 5 }}>
106
                     <Col>
100
                     <Col>

+ 1 - 1
src/Pages/Login.jsx

1
 import * as React from 'react';
1
 import * as React from 'react';
2
 import toast, { Toaster } from 'react-hot-toast';
2
 import toast, { Toaster } from 'react-hot-toast';
3
-import jwt_decode from "jwt-decode";
3
+// import jwt_decode from "jwt-decode";
4
 
4
 
5
 import { 
5
 import { 
6
     Paper, Box, Grid, Checkbox, FormControlLabel, Typography,
6
     Paper, Box, Grid, Checkbox, FormControlLabel, Typography,