Skip to content

Commit 3568eb4

Browse files
committed
Add Exit button for Collab Space
1 parent 458ee97 commit 3568eb4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Frontend/src/components/collab/CollaborationSpace.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
import React from 'react';
2-
import { useParams } from 'react-router-dom';
2+
import { useParams, useNavigate } from 'react-router-dom';
3+
import Button from 'react-bootstrap/Button';
34

45
const CollaborationSpace = () => {
6+
const navigate = useNavigate();
57
const { roomId } = useParams(); // Get the roomId from the URL
68

9+
const handleExit = () => {
10+
navigate("/home")
11+
}
12+
713
return (
814
<div style={{ textAlign: 'center', marginTop: '50px' }}>
915
<h1>Welcome to Collaboration Space</h1>
1016
<p>You are in room: {roomId}</p>
17+
<Button variant="danger" onClick={() => handleExit()}>Exit</Button>{' '}
1118
</div>
1219
);
1320
};

0 commit comments

Comments
 (0)