Skip to content

Commit f8df8f0

Browse files
Merge branch 'main' into feat/preview
2 parents 897b47d + 43a1393 commit f8df8f0

File tree

3 files changed

+89
-12
lines changed

3 files changed

+89
-12
lines changed

frontend/package-lock.json

Lines changed: 42 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"react": "^19.2.0",
2929
"react-dom": "^19.2.0",
3030
"react-hook-form": "^7.65.0",
31+
"react-hotkeys": "^2.0.0",
3132
"react-router-dom": "^7.9.4",
3233
"shadcn": "^3.4.1",
3334
"socket.io-client": "^4.8.1",

frontend/src/pages/InRoom.tsx

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ import {
99
MessageSquare,
1010
} from "lucide-react";
1111
import { motion } from "framer-motion";
12+
import { HotKeys } from "react-hotkeys";
13+
14+
const keyMap = {
15+
TOGGLE_MIC: "ctrl+m",
16+
TOGGLE_VIDEO: "ctrl+v",
17+
TOGGLE_CHAT: "ctrl+c",
18+
};
1219

1320
const InRoom: React.FC<{ roomName: string }> = ({ roomName }) => {
1421
const [micOn, setMicOn] = useState(true);
@@ -138,7 +145,10 @@ const InRoom: React.FC<{ roomName: string }> = ({ roomName }) => {
138145
Send
139146
</button>
140147
</div>
141-
</motion.div>
148+
</div>
149+
))}
150+
<div ref={chatEndRef} />
151+
</div>
142152
)}
143153
</div>
144154

@@ -176,7 +186,41 @@ const InRoom: React.FC<{ roomName: string }> = ({ roomName }) => {
176186
</button>
177187
</footer>
178188
</div>
179-
);
189+
190+
{/* Controls */}
191+
<footer className="p-4 flex justify-center gap-6 border-t border-gray-800 bg-gray-950">
192+
<button
193+
onClick={toggleMic}
194+
className={`p-3 rounded-full ${micOn ? "bg-gray-800" : "bg-red-600"}`}
195+
>
196+
{micOn ? <Mic /> : <MicOff />}
197+
</button>
198+
199+
<button
200+
onClick={toggleVideo}
201+
className={`p-3 rounded-full ${
202+
videoOn ? "bg-gray-800" : "bg-red-600"
203+
}`}
204+
>
205+
{videoOn ? <Video /> : <VideoOff />}
206+
</button>
207+
208+
<button className="p-3 rounded-full bg-red-600 hover:bg-red-700">
209+
<PhoneOff />
210+
</button>
211+
212+
<button
213+
onClick={toggleChat}
214+
className={`p-3 rounded-full ${
215+
showChat ? "bg-indigo-600" : "bg-gray-800"
216+
}`}
217+
>
218+
<MessageSquare />
219+
</button>
220+
</footer>
221+
</div>
222+
</HotKeys>
223+
);
180224
};
181225

182226
export default InRoom;

0 commit comments

Comments
 (0)