浏览代码

g sign loading numers

amenpunk 3 年之前
父节点
当前提交
574269976c
共有 3 个文件被更改,包括 23 次插入9 次删除
  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,6 +1,18 @@
1 1
 import { Link } from 'react-router-dom'
2
+import { CircularProgress, } from '@mui/material'
3
+import { useEffect, useState } from 'react'
2 4
 
3 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 16
     return(
5 17
         <div className="panel" >
6 18
             <Link to={props.to}>
@@ -12,7 +24,13 @@ export function Card( props ){
12 24
                         <props.icon style={{ color :'#fd4b4b', fontSize : 45, margin : 5}}/>
13 25
                     </div>
14 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 34
                     </div>
17 35
                 </div>
18 36
             </Link>

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

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

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

@@ -1,11 +1,7 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-
3 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 6
 import { Row, Col } from 'react-bootstrap';
11 7
 
@@ -93,7 +89,7 @@ export default function Candidatos () {
93 89
                 {
94 90
                     users.length 
95 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 94
                 <Row style={{ padding : 5 }}>
99 95
                     <Col>