Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5058 Rev 5195
Línea -... Línea 1...
-
 
1
/* eslint-disable camelcase */
1
/* eslint-disable react/prop-types */
2
/* eslint-disable react/prop-types */
2
import React, { useState, useRef, useEffect } from "react";
3
import React, { useState, useRef, useEffect } from 'react'
3
import { axios } from "../../../utils";
4
import { axios } from '../../../utils'
4
import styled from "styled-components";
5
import styled from 'styled-components'
5
import Emojione from "./emojione/Emojione";
6
import Emojione from './emojione/Emojione'
6
import SendFileModal from "./send-file-modal/SendFileModal";
7
import SendFileModal from './send-file-modal/SendFileModal'
7
import ConfirmModal from "../../../shared/confirm-modal/ConfirmModal";
8
import ConfirmModal from '../../../shared/confirm-modal/ConfirmModal'
8
import MessageTemplate from "./messageTemplate/MessageTemplate";
9
import MessageTemplate from './messageTemplate/MessageTemplate'
9
import { Modal } from "react-bootstrap";
10
import { Modal } from 'react-bootstrap'
10
import { useForm } from "react-hook-form";
11
import { useForm } from 'react-hook-form'
11
import FormErrorFeedback from "../../../shared/form-error-feedback/FormErrorFeedback";
12
import FormErrorFeedback from '../../../shared/form-error-feedback/FormErrorFeedback'
12
import 'react-datetime/css/react-datetime.css'
13
import 'react-datetime/css/react-datetime.css'
13
import Datetime from "react-datetime";
14
import Datetime from 'react-datetime'
14
import { addNotification } from "../../../redux/notification/notification.actions";
15
import { addNotification } from '../../../redux/notification/notification.actions'
15
import Spinner from "../../../shared/loading-spinner/Spinner";
16
import Spinner from '../../../shared/loading-spinner/Spinner'
16
import { useDispatch } from "react-redux";
17
import { useDispatch } from 'react-redux'
17
import SearchIcon from '@mui/icons-material/Search'
18
import SearchIcon from '@mui/icons-material/Search'
Línea 18... Línea 19...
18
 
19
 
19
const StyledChatHead = styled.div`
20
const StyledChatHead = styled.div`
20
  .notify {
21
  .notify {
Línea 30... Línea 31...
30
    }
31
    }
31
    100% {
32
    100% {
32
      background-color: unset;
33
      background-color: unset;
33
    }
34
    }
34
  }
35
  }
35
`;
36
`
Línea 36... Línea 37...
36
 
37
 
37
const StyledShowOptions = styled.div`
38
const StyledShowOptions = styled.div`
38
  height: 342px;
39
  height: 342px;
39
  flex-direction: column;
40
  flex-direction: column;
40
  gap: 0.5rem;	
41
  gap: 0.5rem;
41
  overflow-y: auto;
42
  overflow-y: auto;
42
  position: relative;
43
  position: relative;
43
  &.show {
44
  &.show {
44
    display: flex;
45
    display: flex;
Línea 72... Línea 73...
72
      align-items: center;
73
      align-items: center;
73
      padding: 0.2rem 0.5rem;
74
      padding: 0.2rem 0.5rem;
74
      border-bottom: 1px solid #e2e2e2;
75
      border-bottom: 1px solid #e2e2e2;
75
    }
76
    }
76
  }
77
  }
77
`;
78
`
Línea 78... Línea 79...
78
 
79
 
79
const PersonalChat = ({ entity, onClose, onMinimize, onRead, not_seen_messages, minimized, timezones }) => {
-
 
80
 
80
const PersonalChat = ({ entity, onClose, onMinimize, onRead, not_seen_messages, minimized, timezones }) => {
81
  const {
81
  const {
82
    id,
82
    id,
83
    image,
83
    image,
84
    name,
84
    name,
Línea 93... Línea 93...
93
    url_delete,
93
    url_delete,
94
    url_add_user_to_group,
94
    url_add_user_to_group,
95
    url_get_contact_group_list,
95
    url_get_contact_group_list,
96
    url_get_contacts_availables_for_group,
96
    url_get_contacts_availables_for_group,
97
    url_zoom
97
    url_zoom
98
  } = entity;
98
  } = entity
Línea 99... Línea 99...
99
 
99
 
100
  // states
100
  // states
101
  const [messages, setMessages] = useState([]);
101
  const [messages, setMessages] = useState([])
102
  const [responseMessage, setResponseMessage] = useState(null);
102
  const [responseMessage, setResponseMessage] = useState(null)
103
  const [oldMessages, setOldMessages] = useState([]);
103
  const [oldMessages, setOldMessages] = useState([])
104
  const [currentPage, setCurrentPage] = useState(1);
104
  const [currentPage, setCurrentPage] = useState(1)
105
  const [pages, setPages] = useState(1);
105
  const [pages, setPages] = useState(1)
106
  const [showOptions, setShowOptions] = useState(false);
106
  const [showOptions, setShowOptions] = useState(false)
107
  const [optionTab, setOptionTab] = useState("default");
107
  const [optionTab, setOptionTab] = useState('default')
108
  const [availableContactsToAdd, setAvailableContactsToAdd] = useState([]);
108
  const [availableContactsToAdd, setAvailableContactsToAdd] = useState([])
109
  const [groupContactsList, setGroupContactsList] = useState([]);
109
  const [groupContactsList, setGroupContactsList] = useState([])
110
  const [confirmModalShow, setConfirmModalShow] = useState(false);
110
  const [confirmModalShow, setConfirmModalShow] = useState(false)
111
  const [showEmojiTab, setShowEmojiTab] = useState(false);
111
  const [showEmojiTab, setShowEmojiTab] = useState(false)
112
  const [shareFileModalShow, setShareFileModalShow] = useState(false);
112
  const [shareFileModalShow, setShareFileModalShow] = useState(false)
113
  const [showConferenceModal, setShowConferenceModal] = useState(false);
113
  const [showConferenceModal, setShowConferenceModal] = useState(false)
114
  const [loading, setLoading] = useState(false);
114
  const [loading, setLoading] = useState(false)
Línea 115... Línea 115...
115
  const [search, setSearch] = useState('');
115
  const [search, setSearch] = useState('')
Línea 116... Línea 116...
116
 
116
 
117
  const filtredGroupList = groupContactsList.filter((conversation) => conversation.name.toLowerCase().includes(search.toLowerCase()))
117
  const filtredGroupList = groupContactsList.filter((conversation) => conversation.name.toLowerCase().includes(search.toLowerCase()))
118
 
118
 
119
  // refs
119
  // refs
120
  const conversationListEl = useRef(null);
120
  const conversationListEl = useRef(null)
121
  const loader = useRef(null);
121
  const loader = useRef(null)
Línea 122... Línea 122...
122
  const modalActionUrl = useRef("");
122
  const modalActionUrl = useRef('')
123
  const chatboxEl = useRef(null);
123
  const chatboxEl = useRef(null)
124
  const textAreaEl = useRef(null);
124
  const textAreaEl = useRef(null)
125
 
125
 
126
  // optionTabs
126
  // optionTabs
127
  const optionTabs = {
127
  const optionTabs = {
128
    add_person_to_group: "add_person_to_group",
128
    add_person_to_group: 'add_person_to_group',
Línea 129... Línea 129...
129
    group_contacts_list: "group_contacts_list",
129
    group_contacts_list: 'group_contacts_list',
130
    meet: 'meet',
130
    meet: 'meet',
131
    default: "default",
131
    default: 'default'
132
  };
132
  }
Línea 133... Línea 133...
133
 
133
 
134
  const handleActive = () => {
134
  const handleActive = () => {
135
    onRead(entity);
135
    onRead(entity)
136
    onMinimize(entity);
136
    onMinimize(entity)
137
  };
137
  }
138
 
138
 
139
  const handleGetMessages = async () => {
139
  const handleGetMessages = async () => {
140
    setLoading(true)
140
    setLoading(true)
141
    const response = await axios.get(url_get_all_messages);
141
    const response = await axios.get(url_get_all_messages)
142
    const resData = response.data;
142
    const resData = response.data
143
    if (!resData.success) {
143
    if (!resData.success) {
144
      return ("ha ocurrido un error", resData);
144
      return ('ha ocurrido un error', resData)
145
    }
145
    }
146
    const updatedMessages = [...resData.data.items].reverse();
146
    const updatedMessages = [...resData.data.items].reverse()
Línea 147... Línea 147...
147
    const newMessages = updatedMessages.reduce((acum, updatedMessage) => {
147
    const newMessages = updatedMessages.reduce((acum, updatedMessage) => {
148
      if (messages.findIndex((message) => message.id === updatedMessage.id) === -1) {
148
      if (messages.findIndex((message) => message.id === updatedMessage.id) === -1) {
149
        acum = [...acum, updatedMessage];
149
        acum = [...acum, updatedMessage]
150
      }
150
      }
151
      return acum;
151
      return acum
152
    }, []);
152
    }, [])
153
 
153
 
154
    if (newMessages.length > 0) {
154
    if (newMessages.length > 0) {
155
      setMessages([...messages, ...newMessages]);
155
      setMessages([...messages, ...newMessages])
156
      setLoading(false)
156
      setLoading(false)
Línea 157... Línea 157...
157
      setPages(resData.data.pages);
157
      setPages(resData.data.pages)
158
      scrollToBottom();
158
      scrollToBottom()
159
    } else {
159
    } else {
160
      setMessages([...updatedMessages]);
160
      setMessages([...updatedMessages])
161
      setLoading(false)
161
      setLoading(false)
162
    }
162
    }
163
  };
163
  }
164
 
164
 
165
  const handleLoadMore = async () => {
165
  const handleLoadMore = async () => {
166
    await axios.get(`${url_get_all_messages}?page=${currentPage}`)
166
    await axios.get(`${url_get_all_messages}?page=${currentPage}`)
167
      .then((response) => {
167
      .then((response) => {
168
        const resData = response.data;
168
        const resData = response.data
169
        if (resData.success) {
169
        if (resData.success) {
Línea 170... Línea 170...
170
          if (resData.data.page > 1) {
170
          if (resData.data.page > 1) {
Línea 171... Línea 171...
171
            const updatedOldMessages = [...resData.data.items].reverse();
171
            const updatedOldMessages = [...resData.data.items].reverse()
172
            setOldMessages([...updatedOldMessages, ...oldMessages]);
172
            setOldMessages([...updatedOldMessages, ...oldMessages])
173
            /* scrollDownBy(100); */
173
            /* scrollDownBy(100); */
174
          }
174
          }
175
        }
175
        }
176
      });
176
      })
177
  };
177
  }
178
 
178
 
179
  const handleCloseChat = () => onClose(entity)
179
  const handleCloseChat = () => onClose(entity)
180
 
180
 
Línea 181... Línea 181...
181
  const handleChatBoxKeyDown = async (e) => {
181
  const handleChatBoxKeyDown = async (e) => {
182
    if (e.key === "Enter") {
182
    if (e.key === 'Enter') {
183
      e.preventDefault();
183
      e.preventDefault()
Línea 184... Línea 184...
184
      const message = e.target.value;
184
      const message = e.target.value
185
      const formData = new FormData();
185
      const formData = new FormData()
186
      formData.append("message", emojione.toShort(message));
186
      formData.append('message', emojione.toShort(message))
187
      await axios.post(url_send, formData).then((response) => {
187
      await axios.post(url_send, formData).then((response) => {
188
        const resData = response.data;
188
        const resData = response.data
189
        if (resData.success) {
189
        if (resData.success) {
190
          let newMessage = resData.data
190
          let newMessage = resData.data
191
 
191
 
192
          online
192
          online
Línea 193... Línea 193...
193
            ? newMessage = { ...newMessage, not_received: false }
193
            ? newMessage = { ...newMessage, not_received: false }
194
            : newMessage = { ...newMessage, not_received: true }
194
            : newMessage = { ...newMessage, not_received: true }
195
 
195
 
196
          setMessages([...messages, newMessage])
196
          setMessages([...messages, newMessage])
Línea 197... Línea 197...
197
        }
197
        }
198
      });
198
      })
199
      e.target.value = "";
199
      e.target.value = ''
Línea 200... Línea 200...
200
      /* await handleGetMessages(); */
200
      /* await handleGetMessages(); */
201
      setShowEmojiTab(false);
201
      setShowEmojiTab(false)
202
      setResponseMessage(null)
202
      setResponseMessage(null)
203
    }
203
    }
204
  };
204
  }
205
 
205
 
206
  const handleShowOptions = () => {
206
  const handleShowOptions = () => {
207
    onMinimize(entity, false);
207
    onMinimize(entity, false)
208
    setShowOptions(!showOptions);
208
    setShowOptions(!showOptions)
209
  };
209
  }
Línea 210... Línea 210...
210
 
210
 
211
  const handleChangeTab = (tab) => {
211
  const handleChangeTab = (tab) => {
212
    setOptionTab(tab);
212
    setOptionTab(tab)
213
  };
213
  }
214
 
214
 
215
  const handleAddPersonToGroup = async (id) => {
215
  const handleAddPersonToGroup = async (id) => {
216
    const formData = new FormData();
216
    const formData = new FormData()
217
    formData.append("uid", id);
217
    formData.append('uid', id)
218
    await axios.post(url_add_user_to_group, formData).then((response) => {
218
    await axios.post(url_add_user_to_group, formData).then((response) => {
219
      const resData = response.data;
219
      const resData = response.data
220
      if (resData.success) {
220
      if (resData.success) {
Línea 221... Línea 221...
221
        loadPersonsAvailable();
221
        loadPersonsAvailable()
222
      }
222
      }
223
    });
223
    })
224
  };
224
  }
225
 
225
 
226
  const handleConfirmModalAction = async () => {
226
  const handleConfirmModalAction = async () => {
Línea 227... Línea 227...
227
    try {
227
    try {
228
      const { data } = await axios.post(modalActionUrl.current)
228
      const { data } = await axios.post(modalActionUrl.current)
229
      if (!data.success) console.log('Error in confirm modal action')
229
      if (!data.success) console.log('Error in confirm modal action')
230
      handleConfirmModalShow()
230
      handleConfirmModalShow()
231
      onClose(entity);
-
 
232
      return
-
 
233
    } catch (error) {
-
 
234
      console.log(error)
-
 
235
    }
-
 
236
  };
-
 
237
 
231
      onClose(entity)
238
  const handleObserver = (entities) => {
232
      return
Línea 239... Línea 233...
239
    const target = entities[0];
233
    } catch (error) {
240
    if (target.isIntersecting) {
234
      console.log(error)
241
      setCurrentPage((prevState) => prevState + 1);
235
    }
242
    }
236
  }
Línea 243... Línea 237...
243
  };
237
 
244
 
238
  const handleObserver = (entities) => {
245
  const scrollToBottom = () => {
239
    const target = entities[0]
246
    if (conversationListEl.current) {
240
    if (target.isIntersecting) {
247
      conversationListEl.current.scrollTop =
241
      setCurrentPage((prevState) => prevState + 1)
248
        conversationListEl.current.scrollHeight * 9;
242
    }
249
    }
243
  }
250
  };
244
 
251
 
245
  const scrollToBottom = () => {
252
  const scrollDownBy = (scrollDistance) => {
246
    if (conversationListEl.current) {
253
    if (conversationListEl.current) {
247
      conversationListEl.current.scrollTop =
254
      conversationListEl.current.scrollTop = scrollDistance;
248
        conversationListEl.current.scrollHeight * 9
255
    }
249
    }
256
  };
250
  }
Línea 257... Línea 251...
257
 
251
 
258
  const handleShowEmojiTab = () => {
252
  const handleShowEmojiTab = () => {
259
    setShowEmojiTab(!showEmojiTab);
253
    setShowEmojiTab(!showEmojiTab)
Línea 260... Línea 254...
260
    // smiley_tpl(`${id}`);
254
    // smiley_tpl(`${id}`);
261
  };
255
  }
262
 
256
 
263
  const handleClickEmoji = (e) => {
257
  const handleClickEmoji = (e) => {
264
    const shortname = e.currentTarget.dataset.shortname;
258
    const shortname = e.currentTarget.dataset.shortname
265
    const currentText = textAreaEl.current.value;
259
    const currentText = textAreaEl.current.value
266
    let cursorPosition = textAreaEl.current.selectionStart;
260
    const cursorPosition = textAreaEl.current.selectionStart
267
    const textBehind = currentText.substring(0, cursorPosition);
261
    const textBehind = currentText.substring(0, cursorPosition)
268
    const textForward = currentText.substring(cursorPosition);
262
    const textForward = currentText.substring(cursorPosition)
269
    const unicode = emojione.shortnameToUnicode(shortname);
263
    const unicode = emojione.shortnameToUnicode(shortname)
270
    textAreaEl.current.value = `${textBehind}${unicode}${textForward}`;
264
    textAreaEl.current.value = `${textBehind}${unicode}${textForward}`
271
    textAreaEl.current.focus();
265
    textAreaEl.current.focus()
272
    textAreaEl.current.setSelectionRange(
266
    textAreaEl.current.setSelectionRange(
273
      cursorPosition + unicode.length,
267
      cursorPosition + unicode.length,
274
      cursorPosition + unicode.length
268
      cursorPosition + unicode.length
275
    );
269
    )
276
  };
270
  }
277
 
271
 
278
  // useEffect(() => {
272
  // useEffect(() => {
279
  //   setMessages([...oldMessages, ...newMessages]);
273
  //   setMessages([...oldMessages, ...newMessages]);
280
  // }, [newMessages, oldMessages]);
274
  // }, [newMessages, oldMessages]);
Línea 281... Línea 275...
281
 
275
 
282
  // getMessageOnMaximize and subscribe to infinite Loader
276
  // getMessageOnMaximize and subscribe to infinite Loader
283
  useEffect(async () => {
277
  useEffect(async () => {
284
    let options = {
278
    const options = {
285
      root: null,
279
      root: null,
286
      rootMargin: "20px",
280
      rootMargin: '20px',
287
      treshold: 1.0,
281
      treshold: 1.0
288
    };
282
    }
Línea 289... Línea 283...
289
    const observer = new IntersectionObserver(handleObserver, options);
283
    const observer = new IntersectionObserver(handleObserver, options)
290
    if (!minimized) {
284
    if (!minimized) {
291
      await handleGetMessages();
285
      await handleGetMessages()
292
      // loader observer
286
      // loader observer
293
      if (loader.current) {
-
 
294
        observer.observe(loader.current);
287
      if (loader.current) {
295
      }
288
        observer.observe(loader.current)
296
    }
289
      }
Línea 297... Línea 290...
297
    return () => {
290
    }
298
      if (loader.current) {
291
    return () => {
299
        observer.unobserve(loader.current);
292
      if (loader.current) {
300
      }
293
        observer.unobserve(loader.current)
301
    };
294
      }
302
  }, [minimized]);
295
    }
303
 
296
  }, [minimized])
304
  // LoadMore on change page
297
 
305
  useEffect(() => {
298
  // LoadMore on change page
Línea 306... Línea 299...
306
    let loadMore = () => handleLoadMore();
299
  useEffect(() => {
Línea 307... Línea 300...
307
    loadMore()
300
    let loadMore = () => handleLoadMore()
Línea 308... Línea 301...
308
    return () => {
301
    loadMore()
309
      loadMore = null;
302
    return () => {
310
    };
303
      loadMore = null
Línea 311... Línea 304...
311
  }, [currentPage]);
304
    }
312
 
305
  }, [currentPage])
313
  // getMessagesInterval
306
 
314
  useEffect(() => {
307
  // getMessagesInterval
Línea 315... Línea 308...
315
    if (window.location.pathname === '/group/my-groups') {
308
  useEffect(() => {
316
      const items = document.getElementsByClassName('sc-jSgupP')
309
    if (window.location.pathname === '/group/my-groups') {
Línea 317... Línea 310...
317
      if (items && items.length > 0)
310
      const items = document.getElementsByClassName('sc-jSgupP')
Línea 318... Línea 311...
318
        items[0].style.display = 'none';
311
      if (items && items.length > 0) { items[0].style.display = 'none' }
319
    }
312
    }
320
  }, [minimized]);
313
  }, [minimized])
321
 
314
 
322
  useEffect(() => {
315
  useEffect(() => {
323
    let timer;
316
    let timer
324
    if (!minimized && !loading) {
317
    if (!minimized && !loading) {
325
      timer = setTimeout(() => handleGetMessages(), 1000);
318
      timer = setTimeout(() => handleGetMessages(), 1000)
326
    }
319
    }
327
    return () => {
320
    return () => {
Línea 328... Línea 321...
328
      clearTimeout(timer);
321
      clearTimeout(timer)
329
    };
322
    }
Línea 330... Línea 323...
330
  }, [minimized, loading]);
323
  }, [minimized, loading])
331
 
324
 
Línea 332... Línea 325...
332
  const handleConfirmModalShow = () => setConfirmModalShow(!confirmModalShow)
325
  const handleConfirmModalShow = () => setConfirmModalShow(!confirmModalShow)
333
 
326
 
334
  const handleConfirmModalAccept = () => handleConfirmModalAction()
327
  const handleConfirmModalAccept = () => handleConfirmModalAction()
335
 
328
 
Línea 385... Línea 378...
385
            setResponseMessage={handleResponseMessage}
378
            setResponseMessage={handleResponseMessage}
386
            responseMessage={responseMessage}
379
            responseMessage={responseMessage}
387
          />
380
          />
388
        })}
381
        })}
389
      </React.Fragment>
382
      </React.Fragment>
390
    );
383
    )
391
  };
384
  }
Línea 392... Línea 385...
392
 
385
 
393
  const optionRender = () => {
386
  const optionRender = () => {
394
    switch (optionTab) {
387
    switch (optionTab) {
395
      case optionTabs.add_person_to_group:
388
      case optionTabs.add_person_to_group:
396
        return addPersonToGroupTab;
389
        return addPersonToGroupTab
397
      case optionTabs.group_contacts_list:
390
      case optionTabs.group_contacts_list:
398
        return groupContactsListTab;
391
        return groupContactsListTab
399
      case optionTabs.meet:
392
      case optionTabs.meet:
400
        return meetingOptionsTab;
393
        return meetingOptionsTab
401
      default:
394
      default:
402
        return optionsDefaultTab;
395
        return optionsDefaultTab
403
    }
396
    }
Línea 404... Línea 397...
404
  };
397
  }
405
 
398
 
406
  // useEffect for tabs changing
399
  // useEffect for tabs changing
407
  useEffect(() => {
400
  useEffect(() => {
408
    switch (optionTab) {
401
    switch (optionTab) {
409
      case optionTabs.add_person_to_group:
402
      case optionTabs.add_person_to_group:
410
        loadPersonsAvailable();
403
        loadPersonsAvailable()
411
        break;
404
        break
412
      case optionTabs.group_contacts_list:
405
      case optionTabs.group_contacts_list:
413
        loadGroupContacts();
406
        loadGroupContacts()
414
        break;
407
        break
Línea 415... Línea 408...
415
    }
408
    }
416
  }, [optionTab]);
409
  }, [optionTab])
417
 
410
 
418
  const loadPersonsAvailable = async () => {
411
  const loadPersonsAvailable = async () => {
419
    await axios.get(url_get_contacts_availables_for_group).then((response) => {
412
    await axios.get(url_get_contacts_availables_for_group).then((response) => {
420
      const resData = response.data;
413
      const resData = response.data
421
      if (resData.success) {
414
      if (resData.success) {
422
        setAvailableContactsToAdd(resData.data);
415
        setAvailableContactsToAdd(resData.data)
Línea 423... Línea 416...
423
      }
416
      }
424
    });
417
    })
425
  };
418
  }
426
 
419
 
427
  const loadGroupContacts = async () => {
420
  const loadGroupContacts = async () => {
428
    await axios.get(url_get_contact_group_list).then((response) => {
421
    await axios.get(url_get_contact_group_list).then((response) => {
429
      const resData = response.data;
422
      const resData = response.data
430
      if (resData.success) {
423
      if (resData.success) {
Línea 431... Línea 424...
431
        setGroupContactsList(resData.data);
424
        setGroupContactsList(resData.data)
432
      }
425
      }
433
    });
426
    })
434
  };
427
  }
435
 
428
 
436
  const handleDeletePersonFromGroup = async (urlDeletePersonFromGroup) => {
429
  const handleDeletePersonFromGroup = async (urlDeletePersonFromGroup) => {
437
    await axios.post(urlDeletePersonFromGroup).then((response) => {
430
    await axios.post(urlDeletePersonFromGroup).then((response) => {
438
      const resData = response.data;
431
      const resData = response.data
Línea 439... Línea 432...
439
      if (resData.success) {
432
      if (resData.success) {
440
        loadGroupContacts();
433
        loadGroupContacts()
441
      }
434
      }
442
    });
435
    })
Línea 484... Línea 477...
484
            </li>
477
            </li>
485
          }
478
          }
486
          {!!url_delete && (
479
          {!!url_delete && (
487
            <li
480
            <li
488
              className="optionsTab__option"
481
              className="optionsTab__option"
489
              style={{ color: "red" }}
482
              style={{ color: 'red' }}
490
              onClick={() => {
483
              onClick={() => {
491
                handleConfirmModalShow();
484
                handleConfirmModalShow()
492
                modalActionUrl.current = url_delete;
485
                modalActionUrl.current = url_delete
493
              }}
486
              }}
494
            >
487
            >
495
              <span className="optionsTab__option__icon">
488
              <span className="optionsTab__option__icon">
496
                <i className="fa fa-trash"></i>
489
                <i className="fa fa-trash"></i>
497
              </span>
490
              </span>
Línea 499... Línea 492...
499
            </li>
492
            </li>
500
          )}
493
          )}
501
          {!!url_leave && (
494
          {!!url_leave && (
502
            <li
495
            <li
503
              className="optionsTab__option"
496
              className="optionsTab__option"
504
              style={{ color: "red" }}
497
              style={{ color: 'red' }}
505
              onClick={() => {
498
              onClick={() => {
506
                handleConfirmModalShow();
499
                handleConfirmModalShow()
507
                modalActionUrl.current = url_leave;
500
                modalActionUrl.current = url_leave
508
              }}
501
              }}
509
            >
502
            >
510
              <span className="optionsTab__option__icon">
503
              <span className="optionsTab__option__icon">
511
                <i className="fa fa-user-times"></i>
504
                <i className="fa fa-user-times"></i>
512
              </span>
505
              </span>
Línea 514... Línea 507...
514
            </li>
507
            </li>
515
          )}
508
          )}
516
        </ul>
509
        </ul>
517
      </div>
510
      </div>
518
    </React.Fragment>
511
    </React.Fragment>
519
  );
512
  )
Línea 520... Línea 513...
520
 
513
 
521
  const meetingOptionsTab = (
514
  const meetingOptionsTab = (
522
    <>
515
    <>
523
      <span className="optionBack" onClick={() => handleShowOptions()}>
516
      <span className="optionBack" onClick={() => handleShowOptions()}>
Línea 535... Línea 528...
535
            Crear conferencia
528
            Crear conferencia
536
          </li>
529
          </li>
537
        </ul>
530
        </ul>
538
      </div>
531
      </div>
539
    </>
532
    </>
540
  );
533
  )
Línea 541... Línea 534...
541
 
534
 
542
  const addPersonToGroupTab = (
535
  const addPersonToGroupTab = (
543
    <React.Fragment>
536
    <React.Fragment>
544
      <span
537
      <span
545
        className="optionBack"
538
        className="optionBack"
546
        onClick={() => handleChangeTab(optionTabs.default)}
539
        onClick={() => handleChangeTab(optionTabs.default)}
547
      >
540
      >
548
        <i className="fa icon-arrow-left"></i>
541
        <i className="fa icon-arrow-left"></i>
549
      </span>
542
      </span>
550
      <div className="addPersonToGroupTab">
543
      <div className="addPersonToGroupTab">
-
 
544
        {availableContactsToAdd.length
551
        {availableContactsToAdd.length ? (
545
          ? (
552
          availableContactsToAdd.map(({ image, name, id }) => (
546
              availableContactsToAdd.map(({ image, name, id }) => (
553
            <div className="addPersonToGroupTab__person" key={id}>
547
            <div className="addPersonToGroupTab__person" key={id}>
554
              <div className="d-inline-flex" style={{ gap: '5px' }}>
548
              <div className="d-inline-flex" style={{ gap: '5px' }}>
555
                <img
549
                <img
556
                  className="chat-image img-circle pull-left"
550
                  className="chat-image img-circle pull-left"
Línea 561... Línea 555...
561
                />
555
                />
562
                <div className="name">{name}</div>
556
                <div className="name">{name}</div>
563
              </div>
557
              </div>
564
              <span
558
              <span
565
                style={{
559
                style={{
566
                  cursor: "pointer",
560
                  cursor: 'pointer'
567
                }}
561
                }}
568
                onClick={() => {
562
                onClick={() => {
569
                  handleAddPersonToGroup(id);
563
                  handleAddPersonToGroup(id)
570
                }}
564
                }}
571
              >
565
              >
572
                <i className="fa fa-plus-circle"></i>
566
                <i className="fa fa-plus-circle"></i>
573
              </span>
567
              </span>
574
            </div>
568
            </div>
-
 
569
              ))
575
          ))
570
            )
576
        ) : (
571
          : (
577
          <div className="addPersonToGroupTab__person">No hay Contactos</div>
572
          <div className="addPersonToGroupTab__person">No hay Contactos</div>
578
        )}
573
            )}
579
      </div>
574
      </div>
580
    </React.Fragment>
575
    </React.Fragment>
581
  );
576
  )
Línea 582... Línea 577...
582
 
577
 
583
  const groupContactsListTab = (
578
  const groupContactsListTab = (
584
    <>
579
    <>
585
      <span className="optionBack" onClick={() => handleChangeTab(optionTabs.default)}>
580
      <span className="optionBack" onClick={() => handleChangeTab(optionTabs.default)}>
Línea 596... Línea 591...
596
      <div className="addPersonToGroupTab">
591
      <div className="addPersonToGroupTab">
597
        {filtredGroupList.length
592
        {filtredGroupList.length
598
          ? filtredGroupList.map(({ image, name, url_remove_from_group, id }) => {
593
          ? filtredGroupList.map(({ image, name, url_remove_from_group, id }) => {
599
            return (
594
            return (
600
              <div className="addPersonToGroupTab__person" key={id}>
595
              <div className="addPersonToGroupTab__person" key={id}>
601
                <div style={{ display: "flex", alignItems: "center" }}>
596
                <div style={{ display: 'flex', alignItems: 'center' }}>
602
                  <img
597
                  <img
603
                    className="chat-image img-circle pull-left"
598
                    className="chat-image img-circle pull-left"
604
                    height="36"
599
                    height="36"
605
                    width="36"
600
                    width="36"
606
                    src={image}
601
                    src={image}
Línea 618... Línea 613...
618
          })
613
          })
619
          : <div className="addPersonToGroupTab__person">No hay Contactos</div>
614
          : <div className="addPersonToGroupTab__person">No hay Contactos</div>
620
        }
615
        }
621
      </div>
616
      </div>
622
    </>
617
    </>
623
  );
618
  )
Línea 624... Línea 619...
624
 
619
 
625
  const userChat = (
620
  const userChat = (
626
    <>
621
    <>
627
      <div className="chatbox active-chat" style={{ display: 'block' }}>
622
      <div className="chatbox active-chat" style={{ display: 'block' }}>
Línea 631... Línea 626...
631
            <small className="unread-msg">2</small>
626
            <small className="unread-msg">2</small>
632
          </div>
627
          </div>
633
        </div>
628
        </div>
634
        <div className="panel personal-chat">
629
        <div className="panel personal-chat">
635
          <StyledChatHead>
630
          <StyledChatHead>
636
            <div className={`panel-heading chatboxhead ${not_seen_messages ? "notify" : ""}`}>
631
            <div className={`panel-heading chatboxhead ${not_seen_messages ? 'notify' : ''}`}>
637
              <div className="panel-title">
632
              <div className="panel-title">
638
                <img
633
                <img
639
                  className="chat-image img-circle pull-left"
634
                  className="chat-image img-circle pull-left"
640
                  height="36"
635
                  height="36"
641
                  width="36"
636
                  width="36"
Línea 645... Línea 640...
645
                <div className="header-elements">
640
                <div className="header-elements">
646
                  <a href={profile} target="_blank" rel="noreferrer">
641
                  <a href={profile} target="_blank" rel="noreferrer">
647
                    {name}
642
                    {name}
648
                  </a>
643
                  </a>
649
                  <br />
644
                  <br />
650
                  <small className={`status ${online ? "Online" : "Offline"}`}>
645
                  <small className={`status ${online ? 'Online' : 'Offline'}`}>
651
                    <b>{online ? "En línea" : "Desconectado"}</b>
646
                    <b>{online ? 'En línea' : 'Desconectado'}</b>
652
                  </small>
647
                  </small>
653
                  <div className="pull-right options">
648
                  <div className="pull-right options">
654
                    <div className="btn-group uploadFile">
649
                    <div className="btn-group uploadFile">
655
                      {/* <span>
650
                      {/* <span>
656
                      <i className="fa fa-trash"></i>
651
                      <i className="fa fa-trash"></i>
Línea 670... Línea 665...
670
                        />
665
                        />
671
                      </span>
666
                      </span>
672
                    </div>
667
                    </div>
673
                    <div className="btn-group">
668
                    <div className="btn-group">
674
                      <span>
669
                      <span>
675
                        <i className={`fa fa-minus-circle`} onClick={handleActive} />
670
                        <i className={'fa fa-minus-circle'} onClick={handleActive} />
676
                      </span>
671
                      </span>
677
                    </div>
672
                    </div>
678
                    <div className="btn-group">
673
                    <div className="btn-group">
679
                      <span>
674
                      <span>
680
                        <i className="fa fa-times-circle" onClick={handleCloseChat} />
675
                        <i className="fa fa-times-circle" onClick={handleCloseChat} />
Línea 685... Línea 680...
685
              </div>
680
              </div>
686
            </div>
681
            </div>
687
          </StyledChatHead>
682
          </StyledChatHead>
688
          <div
683
          <div
689
            className="panel-body"
684
            className="panel-body"
690
            style={{ display: !minimized ? "block" : "none" }}
685
            style={{ display: !minimized ? 'block' : 'none' }}
691
          >
686
          >
692
            <StyledShowOptions className={` ${showOptions ? "show" : "hide"}`}>
687
            <StyledShowOptions className={` ${showOptions ? 'show' : 'hide'}`}>
693
              {optionRender()}
688
              {optionRender()}
694
            </StyledShowOptions>
689
            </StyledShowOptions>
695
            <div
690
            <div
696
              id="uploader_'+chatboxtitle+'"
691
              id="uploader_'+chatboxtitle+'"
697
              style={{ display: "none", height: "342px" }}
692
              style={{ display: 'none', height: '342px' }}
698
            >
693
            >
699
              <p>
694
              <p>
700
                Your browser does not have Flash, Silverlight or HTML5 support.
695
                Your browser does not have Flash, Silverlight or HTML5 support.
701
              </p>
696
              </p>
702
            </div>
697
            </div>
703
            <div
698
            <div
704
              className="chat-conversation"
699
              className="chat-conversation"
705
              style={{ position: "relative", display: showOptions ? 'none' : 'block' }}
700
              style={{ position: 'relative', display: showOptions ? 'none' : 'block' }}
706
            >
701
            >
707
              <div className="reverseChatBox" ref={conversationListEl}>
702
              <div className="reverseChatBox" ref={conversationListEl}>
708
                <ul
703
                <ul
709
                  className="conversation-list chatboxcontent"
704
                  className="conversation-list chatboxcontent"
710
                  id="resultchat_'+chatboxtitle+'"
705
                  id="resultchat_'+chatboxtitle+'"
Línea 713... Línea 708...
713
                </ul>
708
                </ul>
714
              </div>
709
              </div>
715
              <div className="wchat-footer wchat-chat-footer">
710
              <div className="wchat-footer wchat-chat-footer">
716
                <div id="chatFrom" className="chatFrom">
711
                <div id="chatFrom" className="chatFrom">
717
                  {
712
                  {
718
                    responseMessage
713
                    responseMessage &&
719
                    &&
-
 
720
                    <div className={responseMessage ? "resp_messages-container active" : "resp_messages-container"}>
714
                    <div className={responseMessage ? 'resp_messages-container active' : 'resp_messages-container'}>
721
                      <span>{`Respondiendo a ${responseMessage.user_name}`}</span>
715
                      <span>{`Respondiendo a ${responseMessage.user_name}`}</span>
722
                      <p>{responseMessage.m}</p>
716
                      <p>{responseMessage.m}</p>
723
                    </div>
717
                    </div>
724
                  }
718
                  }
725
                  <div className="block-wchat">
719
                  <div className="block-wchat">
Línea 735... Línea 729...
735
                    ></button>
729
                    ></button>
736
                    <div className="input-container">
730
                    <div className="input-container">
737
                      <div className="input-emoji">
731
                      <div className="input-emoji">
738
                        <div
732
                        <div
739
                          className="input-placeholder"
733
                          className="input-placeholder"
740
                          style={{ visibility: "hidden", display: "none" }}
734
                          style={{ visibility: 'hidden', display: 'none' }}
741
                        >
735
                        >
742
                          Escribe un mensaje
736
                          Escribe un mensaje
743
                        </div>
737
                        </div>
744
                        <textarea
738
                        <textarea
745
                          className="input chatboxtextarea"
739
                          className="input chatboxtextarea"
746
                          id="chatboxtextarea"
740
                          id="chatboxtextarea"
747
                          name="chattxt"
741
                          name="chattxt"
748
                          style={{ resize: "none", height: "20px" }}
742
                          style={{ resize: 'none', height: '20px' }}
749
                          placeholder="Escribe un mensaje"
743
                          placeholder="Escribe un mensaje"
750
                          onKeyDown={handleChatBoxKeyDown}
744
                          onKeyDown={handleChatBoxKeyDown}
751
                          ref={textAreaEl}
745
                          ref={textAreaEl}
752
                          onBlur={() => responseMessage && setResponseMessage(null)}
746
                          onBlur={() => responseMessage && setResponseMessage(null)}
753
                          onFocus={() => not_seen_messages && onRead(entity)}
747
                          onFocus={() => not_seen_messages && onRead(entity)}
Línea 768... Línea 762...
768
                    </div>
762
                    </div>
769
                  </div>
763
                  </div>
770
                </div>
764
                </div>
Línea 771... Línea 765...
771
 
765
 
772
                <div className="wchat-box-items-overlay-container">
766
                <div className="wchat-box-items-overlay-container">
773
                  <div className="target-emoji" style={{ display: showEmojiTab ? "block" : "none" }} id={`smileyPanel_${id}`}>
767
                  <div className="target-emoji" style={{ display: showEmojiTab ? 'block' : 'none' }} id={`smileyPanel_${id}`}>
774
                    <Emojione onClickEmoji={handleClickEmoji} />
768
                    <Emojione onClickEmoji={handleClickEmoji} />
775
                  </div>
769
                  </div>
Línea 776... Línea 770...
776
                </div>
770
                </div>
Línea 793... Línea 787...
793
          handleShowOptions()
787
          handleShowOptions()
794
          displayConferenceModal()
788
          displayConferenceModal()
795
        }}
789
        }}
796
      />
790
      />
797
    </>
791
    </>
798
  );
792
  )
Línea 799... Línea 793...
799
 
793
 
800
  const groupChat = (
794
  const groupChat = (
801
    <React.Fragment>
795
    <React.Fragment>
802
      <div
796
      <div
Línea 809... Línea 803...
809
            <small className="unread-msg">2</small>
803
            <small className="unread-msg">2</small>
810
          </div>
804
          </div>
811
        </div>
805
        </div>
812
        <div className="panel personal-chat">
806
        <div className="panel personal-chat">
813
          <StyledChatHead>
807
          <StyledChatHead>
814
            <div className={`panel-heading chatboxhead ${not_seen_messages ? "notify" : ""}`}>
808
            <div className={`panel-heading chatboxhead ${not_seen_messages ? 'notify' : ''}`}>
815
              <div className="panel-title-group">
809
              <div className="panel-title-group">
816
                <img
810
                <img
817
                  className="chat-image img-circle pull-left"
811
                  className="chat-image img-circle pull-left"
818
                  height="36"
812
                  height="36"
819
                  width="36"
813
                  width="36"
Línea 845... Línea 839...
845
                      </span>
839
                      </span>
846
                    </div>
840
                    </div>
847
                    <div className="btn-group">
841
                    <div className="btn-group">
848
                      <span>
842
                      <span>
849
                        <i
843
                        <i
850
                          className={`fa fa-minus-circle`}
844
                          className={'fa fa-minus-circle'}
851
                          onClick={handleActive}
845
                          onClick={handleActive}
852
                        ></i>
846
                        ></i>
853
                      </span>
847
                      </span>
854
                    </div>
848
                    </div>
855
                    <div className="btn-group">
849
                    <div className="btn-group">
Línea 865... Línea 859...
865
              </div>
859
              </div>
866
            </div>
860
            </div>
867
          </StyledChatHead>
861
          </StyledChatHead>
868
          <div
862
          <div
869
            className="panel-body"
863
            className="panel-body"
870
            style={{ display: !minimized ? "block" : "none" }}
864
            style={{ display: !minimized ? 'block' : 'none' }}
871
          >
865
          >
872
            <StyledShowOptions className={` ${showOptions ? "show" : "hide"}`}>
866
            <StyledShowOptions className={` ${showOptions ? 'show' : 'hide'}`}>
873
              {optionRender()}
867
              {optionRender()}
874
            </StyledShowOptions>
868
            </StyledShowOptions>
Línea 875... Línea 869...
875
 
869
 
876
            <div
870
            <div
877
              className="chat-conversation"
871
              className="chat-conversation"
878
              style={{
872
              style={{
879
                display: showOptions ? "none" : "block",
873
                display: showOptions ? 'none' : 'block',
880
                position: "relative",
874
                position: 'relative'
881
              }}
875
              }}
882
            >
876
            >
883
              <div className="reverseChatBox" ref={conversationListEl}>
877
              <div className="reverseChatBox" ref={conversationListEl}>
884
                <ul
878
                <ul
Línea 903... Línea 897...
903
                    ></button>
897
                    ></button>
904
                    <div className="input-container">
898
                    <div className="input-container">
905
                      <div className="input-emoji">
899
                      <div className="input-emoji">
906
                        <div
900
                        <div
907
                          className="input-placeholder"
901
                          className="input-placeholder"
908
                          style={{ visibility: "hidden", display: "none" }}
902
                          style={{ visibility: 'hidden', display: 'none' }}
909
                        >
903
                        >
910
                          Escribe un mensaje
904
                          Escribe un mensaje
911
                        </div>
905
                        </div>
912
                        <textarea
906
                        <textarea
913
                          className="input chatboxtextarea"
907
                          className="input chatboxtextarea"
914
                          id="chatboxtextarea"
908
                          id="chatboxtextarea"
915
                          name="chattxt"
909
                          name="chattxt"
916
                          style={{ resize: "none", height: "20px" }}
910
                          style={{ resize: 'none', height: '20px' }}
917
                          placeholder="Escribe un mensaje"
911
                          placeholder="Escribe un mensaje"
918
                          onKeyDown={handleChatBoxKeyDown}
912
                          onKeyDown={handleChatBoxKeyDown}
919
                          ref={textAreaEl}
913
                          ref={textAreaEl}
920
                          onFocus={() => not_seen_messages && onRead(entity)}
914
                          onFocus={() => not_seen_messages && onRead(entity)}
921
                          onBlur={() => responseMessage && setResponseMessage(null)}
915
                          onBlur={() => responseMessage && setResponseMessage(null)}
Línea 938... Línea 932...
938
                </div>
932
                </div>
939
                <div className="wchat-box-items-positioning-container">
933
                <div className="wchat-box-items-positioning-container">
940
                  <div className="wchat-box-items-overlay-container">
934
                  <div className="wchat-box-items-overlay-container">
941
                    <div
935
                    <div
942
                      className="target-emoji"
936
                      className="target-emoji"
943
                      style={{ display: showEmojiTab ? "block" : "none" }}
937
                      style={{ display: showEmojiTab ? 'block' : 'none' }}
944
                    >
938
                    >
945
                      <div id={`smileyPanel_${id}`}>
939
                      <div id={`smileyPanel_${id}`}>
946
                        <div>
940
                        <div>
947
                          <Emojione onClickEmoji={handleClickEmoji} />
941
                          <Emojione onClickEmoji={handleClickEmoji} />
948
                        </div>
942
                        </div>
Línea 973... Línea 967...
973
        show={shareFileModalShow}
967
        show={shareFileModalShow}
974
        onHide={() => setShareFileModalShow(false)}
968
        onHide={() => setShareFileModalShow(false)}
975
        urlUpload={url_upload}
969
        urlUpload={url_upload}
976
      />
970
      />
977
    </React.Fragment>
971
    </React.Fragment>
978
  );
972
  )
Línea 979... Línea 973...
979
 
973
 
980
  switch (type) {
974
  switch (type) {
981
    case "user":
975
    case 'user':
982
      return userChat;
976
      return userChat
983
    case "group":
977
    case 'group':
984
      return groupChat;
978
      return groupChat
985
    default:
979
    default:
986
      break;
980
      break
987
  }
981
  }
Línea 988... Línea 982...
988
};
982
}
989
 
983
 
990
const StyleModal = ({
984
const StyleModal = ({
991
  title = 'Crea una conferencia',
985
  title = 'Crea una conferencia',
992
  size = 'md',
986
  size = 'md',
993
  show = false,
987
  show = false,
994
  children
-
 
995
}) => {
988
  children
Línea 996... Línea 989...
996
 
989
}) => {
997
  const [isShow, setIsShow] = useState(show)
990
  const [isShow, setIsShow] = useState(show)
998
 
991
 
Línea 1004... Línea 997...
1004
 
997
 
1005
  return (
998
  return (
1006
    <Modal
999
    <Modal
1007
      show={isShow}
1000
      show={isShow}
1008
      onHide={closeModal}
1001
      onHide={closeModal}
1009
      style={{ overflowY: "scroll" }}
1002
      style={{ overflowY: 'scroll' }}
1010
    >
1003
    >
1011
      <Modal.Header closeButton>
1004
      <Modal.Header closeButton>
1012
        <Modal.Title>{title}</Modal.Title>
1005
        <Modal.Title>{title}</Modal.Title>
1013
      </Modal.Header>
1006
      </Modal.Header>
Línea 1022... Línea 1015...
1022
  show = false,
1015
  show = false,
1023
  timezones = {},
1016
  timezones = {},
1024
  zoomUrl = '',
1017
  zoomUrl = '',
1025
  onCreate = () => null
1018
  onCreate = () => null
1026
}) => {
1019
}) => {
1027
 
-
 
1028
  const dt = new Date()
1020
  const dt = new Date()
1029
  const { handleSubmit, register, errors, reset } = useForm({ mode: 'all' })
1021
  const { handleSubmit, register, errors, reset } = useForm({ mode: 'all' })
1030
  const [date, setDate] = useState({
1022
  const [date, setDate] = useState({
1031
    year: dt.toLocaleString("default", { year: "numeric" }),
1023
    year: dt.toLocaleString('default', { year: 'numeric' }),
1032
    month: dt.toLocaleString("default", { month: "2-digit" }),
1024
    month: dt.toLocaleString('default', { month: '2-digit' }),
1033
    day: dt.toLocaleString("default", { day: "2-digit" })
1025
    day: dt.toLocaleString('default', { day: '2-digit' })
1034
  })
1026
  })
1035
  const [time, setTime] = useState(dt.toLocaleString("es", { hour: 'numeric', minute: '2-digit', second: '2-digit' }))
1027
  const [time, setTime] = useState(dt.toLocaleString('es', { hour: 'numeric', minute: '2-digit', second: '2-digit' }))
1036
  const [coferenceType, setConferenceType] = useState(1)
1028
  const [coferenceType, setConferenceType] = useState(1)
1037
  const dispatch = useDispatch()
1029
  const dispatch = useDispatch()
Línea 1038... Línea 1030...
1038
 
1030
 
Línea 1039... Línea 1031...
1039
  const handleChange = (value) => setConferenceType(value)
1031
  const handleChange = (value) => setConferenceType(value)
1040
 
1032
 
1041
  const handleDateTime = (value) => {
1033
  const handleDateTime = (value) => {
1042
    setDate({
1034
    setDate({
1043
      ...date,
1035
      ...date,
1044
      year: new Intl.DateTimeFormat('es', { year: 'numeric' }).format(value),
1036
      year: new Intl.DateTimeFormat('es', { year: 'numeric' }).format(value),
1045
      month: new Intl.DateTimeFormat('es', { month: '2-digit' }).format(value),
1037
      month: new Intl.DateTimeFormat('es', { month: '2-digit' }).format(value),
1046
      day: new Intl.DateTimeFormat('es', { day: '2-digit' }).format(value),
1038
      day: new Intl.DateTimeFormat('es', { day: '2-digit' }).format(value)
1047
    })
1039
    })
Línea 1048... Línea 1040...
1048
    setTime(new Intl.DateTimeFormat('es', { hour: 'numeric', minute: '2-digit', second: 'numeric' }).format(value))
1040
    setTime(new Intl.DateTimeFormat('es', { hour: 'numeric', minute: '2-digit', second: 'numeric' }).format(value))
Línea 1088... Línea 1080...
1088
          <input
1080
          <input
1089
            type="text"
1081
            type="text"
1090
            name="title"
1082
            name="title"
1091
            className="form-control"
1083
            className="form-control"
1092
            maxLength={128}
1084
            maxLength={128}
1093
            ref={register({ required: "Por favor ingrese un título" })}
1085
            ref={register({ required: 'Por favor ingrese un título' })}
1094
          />
1086
          />
1095
          {errors.title && <FormErrorFeedback>{errors.title.message}</FormErrorFeedback>}
1087
          {errors.title && <FormErrorFeedback>{errors.title.message}</FormErrorFeedback>}
1096
        </div>
1088
        </div>
1097
        <div className="form-group">
1089
        <div className="form-group">
1098
          <label htmlFor="first_name">Descripción</label>
1090
          <label htmlFor="first_name">Descripción</label>
1099
          <input
1091
          <input
1100
            type="text"
1092
            type="text"
1101
            name="description"
1093
            name="description"
1102
            className="form-control"
1094
            className="form-control"
1103
            ref={register({ required: "Por favor ingrese una descripción" })}
1095
            ref={register({ required: 'Por favor ingrese una descripción' })}
1104
          />
1096
          />
1105
          {errors.description && <FormErrorFeedback>{errors.description.message}</FormErrorFeedback>}
1097
          {errors.description && <FormErrorFeedback>{errors.description.message}</FormErrorFeedback>}
1106
        </div>
1098
        </div>
1107
        <div className="form-group">
1099
        <div className="form-group">
1108
          <label htmlFor="timezone">Tipo de conferencia</label>
1100
          <label htmlFor="timezone">Tipo de conferencia</label>
Línea 1140... Línea 1132...
1140
        <div className="form-group">
1132
        <div className="form-group">
1141
          <label htmlFor="timezone">Zona horaria</label>
1133
          <label htmlFor="timezone">Zona horaria</label>
1142
          <select
1134
          <select
1143
            className="form-control"
1135
            className="form-control"
1144
            name="timezone"
1136
            name="timezone"
1145
            ref={register({ required: "Por favor elige una Zona horaria" })}
1137
            ref={register({ required: 'Por favor elige una Zona horaria' })}
1146
          >
1138
          >
1147
            <option value="" hidden>
1139
            <option value="" hidden>
1148
              Zona horaria
1140
              Zona horaria
1149
            </option>
1141
            </option>
1150
            {Object.entries(timezones).map(([key, value]) => (
1142
            {Object.entries(timezones).map(([key, value]) => (
Línea 1178... Línea 1170...
1178
          <input
1170
          <input
1179
            type="password"
1171
            type="password"
1180
            name="password"
1172
            name="password"
1181
            className="form-control"
1173
            className="form-control"
1182
            ref={register({
1174
            ref={register({
1183
              required: "Por favor ingrese una contraseña",
1175
              required: 'Por favor ingrese una contraseña',
1184
              maxLength: { value: 6, message: "La contraseña debe tener al menos 6 digitos" }
1176
              maxLength: { value: 6, message: 'La contraseña debe tener al menos 6 digitos' }
1185
            })}
1177
            })}
1186
          />
1178
          />
1187
          {errors.password && <FormErrorFeedback>{errors.password.message}</FormErrorFeedback>}
1179
          {errors.password && <FormErrorFeedback>{errors.password.message}</FormErrorFeedback>}
1188
        </div>
1180
        </div>
1189
        <button className="btn btn-primary" type="submit">
1181
        <button className="btn btn-primary" type="submit">
Línea 1192... Línea 1184...
1192
      </form>
1184
      </form>
1193
    </StyleModal >
1185
    </StyleModal >
1194
  )
1186
  )
1195
}
1187
}
Línea 1196... Línea -...
1196
 
-
 
1197
export default React.memo(PersonalChat);
1188
 
-
 
1189
export default React.memo(PersonalChat)