Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 9469 | Rev 9489 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 9469 Rev 9479
Línea 2... Línea 2...
2
import { Card } from 'react-bootstrap'
2
import { Card } from 'react-bootstrap'
Línea 3... Línea 3...
3
 
3
 
Línea 4... Línea 4...
4
export const MainView = (props) => {
4
export const MainView = (props) => {
5
 
-
 
6
  console.log(props)
-
 
7
  
-
 
8
  /* const [search, setSearch] = useState('');
-
 
9
  const [dataLength, setDataLength] = useState(10);
-
 
10
  const [startItem, setStartItem] = useState(1);
-
 
11
  const [lastItem, setLastItem] = useState(10);
-
 
12
  const [pages, setPages] = useState({
-
 
13
    current: 1,
-
 
14
    last: 1
-
 
15
  });
-
 
16
 
-
 
17
  useEffect(() => {
-
 
18
    getData(search, pages.current, dataLength)
-
 
19
  }, [search, dataLength, pages.current]);
-
 
20
 
-
 
21
  useEffect(() => {
-
 
22
    setPages({ ...pages, last: Math.ceil(data.total / dataLength) })
-
 
23
  }, [data.total]);
-
 
24
 
-
 
25
  useEffect(() => {
-
 
26
    if (pages.current > 1) {
-
 
27
      setStartItem((dataLength * (pages.current - 1)) + 1)
-
 
28
    } else {
-
 
29
      setStartItem(1)
-
 
30
    }
-
 
31
  }, [pages.current]);
-
 
32
 
-
 
33
  useEffect(() => {
-
 
34
    if (data.items) {
-
 
35
      if (startItem > 1) {
-
 
36
        setLastItem(startItem + (data.items.length - 1))
-
 
37
      } else {
-
 
38
        setLastItem(data.items.length)
-
 
39
      }
-
 
40
    }
-
 
Línea 41... Línea 5...
41
  }, [data]); */
5
 
42
 
6
  console.log(props)
43
 
7
 
44
  return (
8
  return (