We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 458ee97 commit 3568eb4Copy full SHA for 3568eb4
Frontend/src/components/collab/CollaborationSpace.jsx
@@ -1,13 +1,20 @@
1
import React from 'react';
2
-import { useParams } from 'react-router-dom';
+import { useParams, useNavigate } from 'react-router-dom';
3
+import Button from 'react-bootstrap/Button';
4
5
const CollaborationSpace = () => {
6
+ const navigate = useNavigate();
7
const { roomId } = useParams(); // Get the roomId from the URL
8
9
+ const handleExit = () => {
10
+ navigate("/home")
11
+ }
12
+
13
return (
14
<div style={{ textAlign: 'center', marginTop: '50px' }}>
15
<h1>Welcome to Collaboration Space</h1>
16
<p>You are in room: {roomId}</p>
17
+ <Button variant="danger" onClick={() => handleExit()}>Exit</Button>{' '}
18
</div>
19
);
20
};
0 commit comments