Browse Source

release v3 fixes

amenpunk 3 years ago
parent
commit
ec95444d46
1 changed files with 5 additions and 14 deletions
  1. 5 14
      src/Components/Home/Candidatos.js

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

1
-import React, { useState, useEffect } from 'react';
1
+import React, { useState } from 'react';
2
 
2
 
3
 import UpdateIcon from '@mui/icons-material/Update';
3
 import UpdateIcon from '@mui/icons-material/Update';
4
 import Typography from '@mui/material/Typography';
4
 import Typography from '@mui/material/Typography';
24
     }
24
     }
25
 
25
 
26
     const [page, setPage] = useState(1);
26
     const [page, setPage] = useState(1);
27
-    const [users, setUser] = useState(list);
27
+    // const [users, setUser] = useState(list);
28
     // const [curret, setCurrent] = useState([]);
28
     // const [curret, setCurrent] = useState([]);
29
 
29
 
30
     const changePage = ( _ , value) => { if(_)
30
     const changePage = ( _ , value) => { if(_)
31
         setPage(value);
31
         setPage(value);
32
     };
32
     };
33
 
33
 
34
-    useEffect(() => {
35
-        // let total_users = users.length;
36
-        // let max_page = 5;
37
-        // let per_page = total_users / max_page;
38
-        //
39
-        // console.log("TOTAL USERS ", users.length)
40
-        // console.log("PER PAGE", per_page)
41
-        // setUser(list)
42
-    },[page])
43
 
34
 
44
     return (
35
     return (
45
         <div className="body_historial">
36
         <div className="body_historial">
59
                     </Row>
50
                     </Row>
60
                 </div>
51
                 </div>
61
                 {
52
                 {
62
-                    users ?
63
-                    users.map( (user, index) => (<Candidato key={user.DPI + index} user={{ ...user, index }}/>)) 
53
+                    list ?
54
+                    list.map( (user, index) => (<Candidato key={user.DPI + index} user={{ ...user, index }}/>)) 
64
                     : undefined
55
                     : undefined
65
                 }
56
                 }
66
                 <Row style={{ padding : 5 }}>
57
                 <Row style={{ padding : 5 }}>
70
                             <Pagination 
61
                             <Pagination 
71
                                 siblingCount={5} 
62
                                 siblingCount={5} 
72
                                 shape='rounded' 
63
                                 shape='rounded' 
73
-                                count={users.length} 
64
+                                count={list.length} 
74
                                 page={page} 
65
                                 page={page} 
75
                                 onChange={changePage} />
66
                                 onChange={changePage} />
76
                         </Stack>
67
                         </Stack>