Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 2278 Rev 2279
Línea 7... Línea 7...
7
import Widget from '@app/components/UI/Widget'
7
import Widget from '@app/components/UI/Widget'
8
import EmptySection from '@app/components/UI/EmptySection'
8
import EmptySection from '@app/components/UI/EmptySection'
9
import { List, ListItem } from '@app/components/UI/List'
9
import { List, ListItem } from '@app/components/UI/List'
Línea 10... Línea 10...
10
 
10
 
11
export default function HomeNews({ currentPost }) {
11
export default function HomeNews({ currentPost }) {
12
  const { data: news } = useFetch('/helpers/posts')
12
  const { data: news } = useFetch('/helpers/posts', [])
13
  const labels = useSelector(({ intl }) => intl.labels)
13
  const labels = useSelector(({ intl }) => intl.labels)
Línea 14... Línea 14...
14
  const history = useHistory()
14
  const history = useHistory()
15
 
15
 
16
  return (
16
  return (
Línea 17... Línea 17...
17
    <Widget>
17
    <Widget>
-
 
18
      <Widget.Header title={labels.posts} />
18
      <Widget.Header title={labels.posts} />
19
 
-
 
20
      <Widget.Body>
-
 
21
        {news?.length <= 0 ? (
19
 
22
          <EmptySection message={labels.not_available_posts} />
20
      <Widget.Body>
23
        ) : null}
21
        <EmptySection message={labels.not_available_posts} />
24
 
Línea 22... Línea 25...
22
        <List>
25
        <List>
23
          {news.map(({ link, title, image, date }) => {
26
          {news?.map(({ link, title, image, date }) => {
24
            if (link.includes(currentPost)) return null
27
            if (link.includes(currentPost)) return null