|
@@ -1,10 +1,10 @@
|
|
|
-import { faSquare, faThLarge, faUserFriends } from '@fortawesome/free-solid-svg-icons';
|
|
|
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
|
-import { Room, RoomEvent, setLogLevel, VideoPresets } from 'livekit-client';
|
|
|
-import { DisplayContext, DisplayOptions, LiveKitRoom } from '@livekit/react-components';
|
|
|
-import { useState } from 'react';
|
|
|
+import {faSquare, faThLarge, faUserFriends} from '@fortawesome/free-solid-svg-icons';
|
|
|
+import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
|
|
+import {Room, RoomEvent, setLogLevel, VideoPresets} from 'livekit-client';
|
|
|
+import {DisplayContext, DisplayOptions, LiveKitRoom} from '@livekit/react-components';
|
|
|
+import {useState} from 'react';
|
|
|
import 'react-aspect-ratio/aspect-ratio.css';
|
|
|
-import { useNavigate, useLocation } from 'react-router-dom';
|
|
|
+import {useNavigate, useLocation} from 'react-router-dom';
|
|
|
|
|
|
// 新增代码
|
|
|
let currentRoom: Room;
|
|
@@ -73,6 +73,10 @@ export const RoomPage = () => {
|
|
|
chat.innerHTML += `<div>${from}: ${str}</div>`;
|
|
|
chat.scrollTop = chat.scrollHeight;
|
|
|
};
|
|
|
+ const closeChat = () => {
|
|
|
+ const chatArea: any = document.getElementById('chat-area');
|
|
|
+ chatArea.style.display = 'none';
|
|
|
+ }
|
|
|
// 新增代码结束
|
|
|
|
|
|
return (
|
|
@@ -86,7 +90,7 @@ export const RoomPage = () => {
|
|
|
<input
|
|
|
id="showStats"
|
|
|
type="checkbox"
|
|
|
- onChange={(e) => updateOptions({ showStats: e.target.checked })}
|
|
|
+ onChange={(e) => updateOptions({showStats: e.target.checked})}
|
|
|
/>
|
|
|
<label htmlFor="showStats">Show Stats</label>
|
|
|
</div>
|
|
@@ -95,23 +99,23 @@ export const RoomPage = () => {
|
|
|
className="iconButton"
|
|
|
disabled={displayOptions.stageLayout === 'grid'}
|
|
|
onClick={() => {
|
|
|
- updateOptions({ stageLayout: 'grid' });
|
|
|
+ updateOptions({stageLayout: 'grid'});
|
|
|
}}
|
|
|
>
|
|
|
- <FontAwesomeIcon height={32} icon={faThLarge} />
|
|
|
+ <FontAwesomeIcon height={32} icon={faThLarge}/>
|
|
|
</button>
|
|
|
<button
|
|
|
className="iconButton"
|
|
|
disabled={displayOptions.stageLayout === 'speaker'}
|
|
|
onClick={() => {
|
|
|
- updateOptions({ stageLayout: 'speaker' });
|
|
|
+ updateOptions({stageLayout: 'speaker'});
|
|
|
}}
|
|
|
>
|
|
|
- <FontAwesomeIcon height={32} icon={faSquare} />
|
|
|
+ <FontAwesomeIcon height={32} icon={faSquare}/>
|
|
|
</button>
|
|
|
</div>
|
|
|
<div className="participantCount">
|
|
|
- <FontAwesomeIcon icon={faUserFriends} />
|
|
|
+ <FontAwesomeIcon icon={faUserFriends}/>
|
|
|
<span>{numParticipants}</span>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -142,12 +146,15 @@ export const RoomPage = () => {
|
|
|
</div>
|
|
|
{
|
|
|
currentRoom &&
|
|
|
- <div className="chat-area">
|
|
|
- <h2>Chat</h2>
|
|
|
+ <div className="chat-area" id="chat-area">
|
|
|
+ <div className="title">
|
|
|
+ <h2>Chat</h2>
|
|
|
+ <div className="close" onClick={closeChat}>x</div>
|
|
|
+ </div>
|
|
|
<div className="chat" id="chat"></div>
|
|
|
<div className="send">
|
|
|
- <input type="text" className="input" id="entry" placeholder="Enter your message" />
|
|
|
- <button className="btn" type="button" onClick={enterText}>
|
|
|
+ <input type="text" className="input" id="entry" placeholder="Enter your message"/>
|
|
|
+ <button className="chat-btn" onClick={enterText}>
|
|
|
Send
|
|
|
</button>
|
|
|
</div>
|