Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1676 Rev 1677
Línea 1... Línea 1...
1
import React, { useEffect, useRef, useState } from 'react'
1
import React, { useEffect, useRef, useState } from 'react'
2
import { axios, scrollToBottom } from '../../utils'
2
import { axios, scrollToBottom } from '../../utils'
3
import { useDispatch } from 'react-redux'
3
import { useDispatch } from 'react-redux'
4
import { addNotification } from '../../redux/notification/notification.actions'
4
import { addNotification } from '../../redux/notification/notification.actions'
5
import InboxIcon from '@mui/icons-material/Inbox'
-
 
Línea 6... Línea 5...
6
 
5
 
7
import Chat from './Chat'
-
 
8
import EmptySection from '../UI/EmptySection'
6
import Chat from './Chat'
9
import ConferenceModal from '../modals/ConferenceModal'
7
import ConferenceModal from '../modals/ConferenceModal'
10
import useMessages from '../../hooks/useMessages'
8
import useMessages from '../../hooks/useMessages'
Línea 11... Línea 9...
11
import ConfirmModal from '../modals/ConfirmModal'
9
import ConfirmModal from '../modals/ConfirmModal'
Línea 34... Línea 32...
34
    url_leave, // Group url
32
    url_leave, // Group url
35
    name,
33
    name,
36
    profile
34
    profile
37
  } = entity
35
  } = entity
Línea 38... Línea 36...
38
 
36
 
-
 
37
  const { messages, loadMore, loading, report } =
39
  const { messages, loadMore, loading } = useMessages(url_get_all_messages)
38
    useMessages(url_get_all_messages)
40
  const [isShowConferenceModal, setisShowConferenceModal] = useState(false)
39
  const [isShowConferenceModal, setisShowConferenceModal] = useState(false)
41
  const [isShowConfirmModal, setisShowConfirmModal] = useState(false)
40
  const [isShowConfirmModal, setisShowConfirmModal] = useState(false)
42
  const [options, setOptions] = useState([])
41
  const [options, setOptions] = useState([])
43
  const scrollRef = useRef(null)
42
  const scrollRef = useRef(null)
Línea 140... Línea 139...
140
          options={options}
139
          options={options}
141
        >
140
        >
142
          <Chat.Title url={profile}>{name}</Chat.Title>
141
          <Chat.Title url={profile}>{name}</Chat.Title>
143
        </Chat.Header>
142
        </Chat.Header>
Línea 144... Línea -...
144
 
-
 
145
        {!messages.length ? (
-
 
146
          <EmptySection
-
 
147
            Icon={<InboxIcon />}
-
 
148
            message='No hay mensajes en esta conversación'
-
 
149
            align='center'
-
 
150
          />
-
 
151
        ) : (
143
 
152
          <Chat.List
144
        <Chat.List
153
            messages={messages}
145
          messages={messages}
154
            onPagination={loadMore}
146
          onPagination={loadMore}
155
            loading={loading}
147
          loading={loading}
156
            scrollRef={scrollRef}
148
          scrollRef={scrollRef}
157
          />
149
          onReport={report}
Línea 158... Línea 150...
158
        )}
150
        />
159
 
151
 
160
        <Chat.SubmitForm
152
        <Chat.SubmitForm
161
          sendUrl={url_send}
153
          sendUrl={url_send}