|
1 | 1 | import React, { useEffect, useState } from 'react';
|
2 | 2 | import { useParams, useNavigate } from 'react-router-dom';
|
3 |
| -import { Editor } from '@monaco-editor/react'; |
4 | 3 | import * as Y from 'yjs';
|
5 | 4 | import { WebsocketProvider } from 'y-websocket';
|
6 |
| -import Button from 'react-bootstrap/Button'; |
7 | 5 | import { getUserFromToken } from '../user/userAvatarBox';
|
| 6 | +import QuestionDisplay from './QuestionDisplay'; |
| 7 | +import Chat from './Chat'; |
| 8 | +import CollabNavigationBar from './CollabNavigationBar'; |
| 9 | +import CodingSpace from './CodeSpace'; |
| 10 | +import { Container, Row, Col } from 'react-bootstrap'; |
8 | 11 |
|
9 | 12 | const CollaborationSpace = () => {
|
10 | 13 | const navigate = useNavigate();
|
@@ -102,23 +105,19 @@ const CollaborationSpace = () => {
|
102 | 105 | }
|
103 | 106 |
|
104 | 107 | return (
|
105 |
| - <div style={{ textAlign: 'center', marginTop: '50px' }}> |
106 |
| - <h1>Welcome to Collaboration Space</h1> |
107 |
| - <p>You are in room: {roomId}</p> |
108 |
| - <h3>Connected Users:</h3> |
109 |
| - <ul> |
110 |
| - {users.map(user => { |
111 |
| - return <li key={user}>{user}</li> |
112 |
| - })} |
113 |
| - </ul> |
114 |
| - <Editor |
115 |
| - height="800px" |
116 |
| - language="javascript" // change this later to get from params too |
117 |
| - value={code} |
118 |
| - theme="vs-dark" |
119 |
| - onChange={handleEditorChange} |
120 |
| - /> |
121 |
| - <Button variant="danger" onClick={() => handleExit()}>Exit</Button>{' '} |
| 108 | + <div> |
| 109 | + <CollabNavigationBar handleExit={handleExit} users={users}/> |
| 110 | + <Container fluid style={{ marginTop: '20px' }}> |
| 111 | + <Row> |
| 112 | + <Col md={8}> |
| 113 | + <CodingSpace handleEditorChange={handleEditorChange} code={code}/> |
| 114 | + </Col> |
| 115 | + <Col md={4}> |
| 116 | + <QuestionDisplay/> |
| 117 | + <Chat/> |
| 118 | + </Col> |
| 119 | + </Row> |
| 120 | + </Container> |
122 | 121 | </div>
|
123 | 122 | );
|
124 | 123 | };
|
|
0 commit comments