File tree Expand file tree Collapse file tree 3 files changed +89
-12
lines changed
Expand file tree Collapse file tree 3 files changed +89
-12
lines changed Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change @@ -9,6 +9,13 @@ import {
99 MessageSquare ,
1010} from "lucide-react" ;
1111import { 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
1320const 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 < / d i v >
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 / > : < V i d e o O f f / > }
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+ < / b u t t o n >
220+ </footer >
221+ < / d i v >
222+ </HotKeys >
223+ ) ;
180224} ;
181225
182226export default InRoom ;
You can’t perform that action at this time.
0 commit comments