Skip to content

Commit ed4f532

Browse files
committed
Make CollabSpacce UI responsive
1 parent fbeb72e commit ed4f532

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

Frontend/src/components/collab/CollaborationSpace.jsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ const CollaborationSpace = () => {
236236

237237
return (
238238

239-
<div style={{ textAlign: 'center', height: '100vh', overflow: 'hidden' }}>
239+
<div style={{ height: '100vh', overflow: 'hidden' }}>
240240
{showAccessDeniedToast ? (
241-
<ToastContainer className="p-3" position="top-center" style={{ zIndex: 1 }}>
241+
<ToastContainer className="p-3" position="top-center" style={{ zIndex: 1, textAlign: 'center' }}>
242242
<Toast
243243
onClose={handleCloseToast}
244244
show={showAccessDeniedToast}
@@ -263,19 +263,21 @@ const CollaborationSpace = () => {
263263
</Toast>
264264
))}
265265
</ToastContainer>
266-
<CollabNavigationBar handleExit={handleExit} handleCodeRun={handleCodeRun} users={users} setLanguage={setLanguage} language={language}/>
267-
<Container fluid style={{ marginTop: '20px', height: 'calc(100vh - 60px)', display: 'flex', overflow: 'hidden' }}>
266+
<CollabNavigationBar handleExit={handleExit} handleCodeRun={handleCodeRun} users={users} setLanguage={setLanguage} language={language} userLangChange={handleLanguageChange}/>
267+
<Container fluid style={{ marginTop: '10px', height: 'calc(100vh - 60px)', display: 'flex', overflow: 'hidden' }}>
268268
<Row style={{ flexGrow: 1, width: '100%', height: '100%', overflow: 'hidden' }}>
269269
<Col md={6} style={{ display: 'flex', flexDirection: 'column', height: '100%', overflow: 'hidden' }}>
270-
<CodeSpace handleEditorChange={handleEditorChange} loading={outputLoading} code={code} language={language} output={output}/>
270+
<CodeSpace handleEditorChange={handleEditorChange} loading={outputLoading} code={code} language={language} output={output} isError={isError}/>
271271
</Col>
272272
<Col md={6} style={{ display: 'flex', flexDirection: 'column', height: '100%', overflow: 'hidden' }}>
273-
<div style={{ flex: '60%', display: 'flex', overflow: 'hidden' }}>
274-
<QuestionDisplay question={question}/>
273+
<div style={{ flex: '60%', display: 'flex', overflow: 'hidden', width:'100%' }}>
274+
<QuestionDisplay question={question} style={{width:'100%'}}/>
275275
</div>
276-
<div style={{ flex: '40%', overflow: 'hidden' }}>
276+
277+
<div style={{ flex: '40%', height:'100%', marginBottom: '20px' }}>
277278
<Chat currentUser={userId} messages={messages} sendMessage={sendMessage}/>
278279
</div>
280+
279281
</Col>
280282
</Row>
281283
</Container>

Frontend/src/components/collab/QuestionDisplay.jsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState, useEffect } from 'react';
2-
import { Card } from 'react-bootstrap';
2+
import { Card, Col} from 'react-bootstrap';
33
import { getQuestionsByCategory } from '../../services/questions';
44

55
const QuestionDisplay = ({ question }) => {
@@ -12,13 +12,13 @@ const QuestionDisplay = ({ question }) => {
1212
}
1313

1414
return (
15-
<Card>
16-
<Card.Header>{question ? `${question.title} (${question.complexity})` : "Loading..."}</Card.Header>
17-
<Card.Body style={{textAlign: 'left'}}>
18-
<p>{question ? question.category.join(", ") : "Loading question description..."}</p>
19-
<p>{question ? question.description : "Loading question description..."}</p>
20-
</Card.Body>
21-
</Card>
15+
<Card style={{ width: '100%' }}>
16+
<Card.Header>{question ? `${question.title} (${question.complexity})` : "Loading..."}</Card.Header>
17+
<Card.Body style={{ textAlign: 'left' }}>
18+
<p>{question ? question.category.join(", ") : "Loading question description..."}</p>
19+
<p>{question ? question.description : "Loading question description..."}</p>
20+
</Card.Body>
21+
</Card>
2222
);
2323
};
2424

0 commit comments

Comments
 (0)