Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 7248 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 7248 Rev 7250
Línea 1... Línea 1...
1
import React, { useState } from 'react'
1
import React from 'react'
2
import { useSelector } from 'react-redux'
2
import { useSelector } from 'react-redux'
3
import styled, { css } from 'styled-components'
3
import styled, { css } from 'styled-components'
4
import Avatar from '@mui/material/Avatar'
4
import Avatar from '@mui/material/Avatar'
Línea 5... Línea 5...
5
 
5
 
Línea 80... Línea 80...
80
const List = ({
80
const List = ({
81
  contacts = [],
81
  contacts = [],
82
  onChange = () => null,
82
  onChange = () => null,
83
  currentConversation,
83
  currentConversation,
84
}) => {
84
}) => {
85
  const [isCurrent, setIsCurrent] = useState(false)
-
 
86
  const labels = useSelector(({ intl }) => intl.labels)
85
  const labels = useSelector(({ intl }) => intl.labels)
Línea 87... Línea 86...
87
 
86
 
88
  return (
87
  return (
89
    <ContactList>
88
    <ContactList>
90
      {!contacts.length ? (
89
      {!contacts.length ? (
91
        <EmptySection message={labels.datatable_szerorecords} />
90
        <EmptySection message={labels.datatable_szerorecords} />
92
      ) : (
91
      ) : (
93
        contacts.map((contact) => {
-
 
94
          if (currentConversation && currentConversation.id === contact.id) {
-
 
95
            setIsCurrent(true)
-
 
96
          }
-
 
97
          if (
-
 
98
            currentConversation &&
-
 
99
            currentConversation.uuid === contact.uuid
-
 
100
          ) {
-
 
101
            setIsCurrent(true)
-
 
102
          }
-
 
103
 
92
        contacts.map((contact) => {
104
          return (
93
          return (
105
            <li key={contact.id || contact.uuid}>
-
 
106
              <List.Item
-
 
107
                contact={contact}
94
            <li key={contact.id || contact.uuid}>
108
                onClick={onChange}
-
 
109
                isCurrent={isCurrent}
-
 
110
              />
95
              <List.Item contact={contact} onClick={onChange} />
111
            </li>
96
            </li>
112
          )
97
          )
113
        })
98
        })
114
      )}
99
      )}