Browse Source

g sign loading numers

amenpunk 3 years ago
parent
commit
574269976c
3 changed files with 23 additions and 9 deletions
  1. 19 1
      src/Components/Card.js
  2. 2 2
      src/Components/Home/Candidato.jsx
  3. 2 6
      src/Components/Home/Candidatos.js

+ 19 - 1
src/Components/Card.js

1
 import { Link } from 'react-router-dom'
1
 import { Link } from 'react-router-dom'
2
+import { CircularProgress, } from '@mui/material'
3
+import { useEffect, useState } from 'react'
2
 
4
 
3
 export function Card( props ){
5
 export function Card( props ){
6
+
7
+    let [loading, setLoading] = useState(true);
8
+
9
+    useEffect(() => {
10
+        setTimeout(() =>{
11
+            setLoading(false)
12
+        },3000)
13
+    },[loading])
14
+
15
+
4
     return(
16
     return(
5
         <div className="panel" >
17
         <div className="panel" >
6
             <Link to={props.to}>
18
             <Link to={props.to}>
12
                         <props.icon style={{ color :'#fd4b4b', fontSize : 45, margin : 5}}/>
24
                         <props.icon style={{ color :'#fd4b4b', fontSize : 45, margin : 5}}/>
13
                     </div>
25
                     </div>
14
                     <div className="content_info">
26
                     <div className="content_info">
15
-                        <p>{props.quantity}</p>
27
+                        {
28
+                        loading ?
29
+                            <p style={{ paddingTop : 10}}>
30
+                                <CircularProgress />
31
+                            </p>
32
+                            : <h3>{ props.quantity }</h3>
33
+                    }
16
                     </div>
34
                     </div>
17
                 </div>
35
                 </div>
18
             </Link>
36
             </Link>

+ 2 - 2
src/Components/Home/Candidato.jsx

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

+ 2 - 6
src/Components/Home/Candidatos.js

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-
3
 import UpdateIcon from '@mui/icons-material/Update';
2
 import UpdateIcon from '@mui/icons-material/Update';
4
 
3
 
5
-import {
6
-    Typography, Pagination, Stack, 
7
-    // CircularProgress, Box
8
-} from '@mui/material'
4
+import { Typography, Pagination, Stack, } from '@mui/material'
9
 
5
 
10
 import { Row, Col } from 'react-bootstrap';
6
 import { Row, Col } from 'react-bootstrap';
11
 
7
 
93
                 {
89
                 {
94
                     users.length 
90
                     users.length 
95
                     ? users[page - 1].map( user => (<Candidato key={user.DPI} user={user}/>)) 
91
                     ? users[page - 1].map( user => (<Candidato key={user.DPI} user={user}/>)) 
96
-                    : <Preview lenght={10}/>
92
+                    : <Preview style={{ paddingTop:10}} lenght={10}/>
97
                 }
93
                 }
98
                 <Row style={{ padding : 5 }}>
94
                 <Row style={{ padding : 5 }}>
99
                     <Col>
95
                     <Col>