Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 16006 Rev 16226
Línea 3... Línea 3...
3
import { useForm } from "react-hook-form";
3
import { useForm } from "react-hook-form";
Línea 4... Línea 4...
4
 
4
 
5
import Emojione from "./emojione/Emojione";
5
import Emojione from "./emojione/Emojione";
6
import FileModal from "./fileModal/FileModal";
6
import FileModal from "./fileModal/FileModal";
-
 
7
import MessagesList from "./messages/MessagesList";
7
import MessagesList from "./messages/MessagesList";
8
import IconButton from "@mui/material/IconButton";
8
import AttachFileIcon from "@mui/icons-material/AttachFile";
9
import AttachFileIcon from "@mui/icons-material/AttachFile";
9
import InsertEmoticonIcon from "@mui/icons-material/InsertEmoticon";
10
import InsertEmoticonIcon from "@mui/icons-material/InsertEmoticon";
-
 
11
import SendIcon from "@mui/icons-material/Send";
Línea 10... Línea 12...
10
import SendIcon from "@mui/icons-material/Send";
12
import MoreVertIcon from "@mui/icons-material/MoreVert";
Línea 11... Línea 13...
11
 
13
 
12
import styles from "./chat.module.scss";
14
import styles from "./chat.module.scss";
Línea 197... Línea 199...
197
 
199
 
Línea 198... Línea 200...
198
  useEffect(() => axios.post(url_mark_seen), []);
200
  useEffect(() => axios.post(url_mark_seen), []);
199
 
201
 
200
  return (
-
 
201
    <div className={styles.chat}>
202
  return (
202
      <div className={styles.chat_header}>
-
 
203
        <h2>{entity.name}</h2>
203
    <div className={styles.chat}>
204
      </div>
204
      <Chat.Header name={entity.name} />
205
      <MessagesList
205
      <MessagesList
206
        isLastPage={currentPage >= totalPages}
206
        isLastPage={currentPage >= totalPages}
207
        messages={[...oldMessages, ...messages]}
207
        messages={[...oldMessages, ...messages]}
Línea 257... Línea 257...
257
      )}
257
      )}
258
    </div>
258
    </div>
259
  );
259
  );
260
};
260
};
Línea -... Línea 261...
-
 
261
 
-
 
262
const Header = ({ name, conferenceUrl }) => {
-
 
263
  const [isShowConferenceModal, setisShowConferenceModal] = useState(false);
-
 
264
 
-
 
265
  const toggleConferenceModal = () =>
-
 
266
    setisShowConferenceModal(!isShowConferenceModal);
-
 
267
 
-
 
268
  const options = [
-
 
269
    { label: "Crear Conferencia", action: toggleConferenceModal },
-
 
270
  ];
-
 
271
 
-
 
272
  return (
-
 
273
    <div className={styles.chat_header}>
-
 
274
      <h2>{name}</h2>
-
 
275
      <Header.Options options={options} />
-
 
276
    </div>
-
 
277
  );
-
 
278
};
-
 
279
 
-
 
280
const Options = ({ options }) => {
-
 
281
  const [isShowMenu, setIsShowMenu] = useState(false);
-
 
282
 
-
 
283
  const toggleOptions = () => {
-
 
284
    setIsShowMenu(!isShowMenu);
-
 
285
  };
-
 
286
 
-
 
287
  return (
-
 
288
    <div className="options">
-
 
289
      <IconButton onClick={toggleOptions}>
-
 
290
        <MoreVertIcon />
-
 
291
      </IconButton>
-
 
292
      <div className="position-relative">
-
 
293
        <div className={`feed-options ${isShowMenu ? "active" : ""}`}>
-
 
294
          <ul>
-
 
295
            {options.map((option, index) => (
-
 
296
              <li key={index}>
-
 
297
                <button className="option-btn" onClick={option.action}>
-
 
298
                  {option.label}
-
 
299
                </button>
-
 
300
              </li>
-
 
301
            ))}
-
 
302
          </ul>
-
 
303
        </div>
-
 
304
      </div>
-
 
305
    </div>
-
 
306
  );
-
 
307
};
-
 
308
 
-
 
309
Chat.Header = Header;
-
 
310
Header.Options = Options;
261
 
311