Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 2923 Rev 2942
Línea 1... Línea 1...
1
import React, { useMemo, useState } from 'react'
1
import React, { useMemo, useState } from 'react'
2
import { useSelector } from 'react-redux'
2
import { useSelector } from 'react-redux'
3
import { IconButton, styled } from '@mui/material'
3
import { IconButton, styled, Typography } from '@mui/material'
4
import { ExpandLess, ExpandMore } from '@mui/icons-material'
4
import { ExpandLess, ExpandMore } from '@mui/icons-material'
Línea 5... Línea 5...
5
 
5
 
Línea 6... Línea 6...
6
import { useFetch } from '@hooks'
6
import { useFetch } from '@hooks'
Línea 31... Línea 31...
31
    </Widget>
31
    </Widget>
32
  )
32
  )
33
}
33
}
Línea 34... Línea 34...
34
 
34
 
35
const Item = ({ url = '/helpers/my-groups', title = 'Mis grupos' }) => {
-
 
36
  const { data } = useFetch(url, [])
35
const Item = ({ url = '/helpers/my-groups', title = 'Mis grupos' }) => {
37
  const [displayMenu, setDisplayMenu] = useState(false)
36
  const [displayMenu, setDisplayMenu] = useState(false)
38
  const [lookMore, setLookMore] = useState(false)
37
  const [lookMore, setLookMore] = useState(false)
Línea -... Línea 38...
-
 
38
  const labels = useSelector(({ intl }) => intl.labels)
-
 
39
 
-
 
40
  const { data } = useFetch(url, [])
39
  const labels = useSelector(({ intl }) => intl.labels)
41
 
-
 
42
  const items = useMemo(() => {
-
 
43
    if (!lookMore) return [...data].slice(0, 3)
Línea 40... Línea 44...
40
 
44
    return data
Línea 41... Línea 45...
41
  const items = useMemo(() => (lookMore ? data : data?.slice(0, 3)), [lookMore])
45
  }, [lookMore])
42
 
46
 
43
  const toggleMenu = () => setDisplayMenu(!displayMenu)
47
  const toggleMenu = () => setDisplayMenu(!displayMenu)
44
 
48
 
-
 
49
  return (
45
  return (
50
    <>
46
    <>
51
      <HelperItem>
47
      <HelperItem>
52
        <Typography variant='overline'>{title}</Typography>
48
        <span>{title}</span>
53