Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 15998 Rev 15999
Línea 127... Línea 127...
127
  const removeSelectedFile = () => {
127
  const removeSelectedFile = () => {
128
    setSelectedFile("");
128
    setSelectedFile("");
129
  };
129
  };
Línea 130... Línea 130...
130
 
130
 
-
 
131
  // On send
-
 
132
  const handleKeyDown = (w) => {
-
 
133
    if (e.key !== "Enter") return false;
-
 
134
    onHandleSubmit();
-
 
135
  };
131
  // On send
136
 
132
  const onHandleSubmit = () => {
137
  const onHandleSubmit = () => {
133
    const formData = new FormData();
138
    const formData = new FormData();
134
    formData.append("message", emojione.toShort(inputTextEl.current.value));
139
    formData.append("message", emojione.toShort(inputTextEl.current.value));
135
    axios.post(url_send, formData).then(({ data: response }) => {
140
    axios.post(url_send, formData).then(({ data: response }) => {
Línea 181... Línea 186...
181
  useEffect(() => axios.post(url_mark_seen), []);
186
  useEffect(() => axios.post(url_mark_seen), []);
Línea 182... Línea 187...
182
 
187
 
183
  return (
188
  return (
184
    <div className={styles.chat}>
189
    <div className={styles.chat}>
-
 
190
      <div className={styles.messagesContainer} ref={bottomToScroll}>
185
      <div className={styles.messagesContainer} ref={bottomToScroll}>
191
        <div ref={divToScroll} />
186
        <MessagesList
192
        <MessagesList
187
          isLastPage={currentPage >= totalPages}
193
          isLastPage={currentPage >= totalPages}
188
          messages={[...oldMessages, ...messages]}
194
          messages={[...oldMessages, ...messages]}
189
          onIntersection={onIntersection}
195
          onIntersection={onIntersection}
190
        />
-
 
191
        <div ref={divToScroll} />
196
        />
192
      </div>
197
      </div>
193
      <div className={styles.chat__input__container}>
198
      <div className={styles.chat__input__container}>
194
        {showEmojione && <Emojione onClickEmoji={onClickEmoji} />}
199
        {showEmojione && <Emojione onClickEmoji={onClickEmoji} />}
195
        <form
200
        <form
Línea 220... Línea 225...
220
          <textarea
225
          <textarea
221
            className={styles.chatInput}
226
            className={styles.chatInput}
222
            placeholder="Escribe un mensaje"
227
            placeholder="Escribe un mensaje"
223
            rows="1"
228
            rows="1"
224
            ref={inputTextEl}
229
            ref={inputTextEl}
-
 
230
            onKeyDown={handleKeyDown}
225
          />
231
          />
226
          <button type="submit" className={"btn " + styles.send_btn}>
232
          <button type="submit" className={"btn " + styles.send_btn}>
227
            <SendIcon />
233
            <SendIcon />
228
          </button>
234
          </button>
229
        </form>
235
        </form>