Skip to content

Commit

Permalink
Merge pull request #15 from AniketSinghShaktawat/showReviews
Browse files Browse the repository at this point in the history
Fixed UI for Show Review
  • Loading branch information
AniketSinghShaktawat authored Apr 21, 2024
2 parents 804896a + 81e6b98 commit d2297f8
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/pages/ViewTeamGrades/ShowReviews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ const ShowReviews: React.FC<ShowReviewsProps> = ({ data }) => {

// Assuming 'reviews' array exists inside the first 'question' of the first 'round'.
const num_of_reviews = data[r][0].reviews.length;
reviewElements.push(<b>Round {r+1}</b>)
reviewElements.push(<div className="round-heading">Round {r+1}</div>)
for (let i = 0; i < num_of_reviews; i++) {
reviewElements.push(<b>Review {i+1}</b>)
reviewElements.push(<div className="review-heading">Review {i+1}</div>);
for (let j = 0; j < num_of_questions; j++) {
reviewElements.push(
<div key={`round-${r}-question-${j}-review-${i}`}>
<div>{data[r][j].questionText}</div>
<div>Score: {data[r][j].reviews[i].score}</div>
{data[r][j].reviews[i].comment && (
<div>Comment: {data[r][j].reviews[i].comment}</div>
)}
<div key={`round-${r}-question-${j}-review-${i}`} className="review-block">
<div className="question">{j+1}. {data[r][j].questionText}</div>
<div className="score-container">
<span className="score">{data[r][j].reviews[i].score}</span>
{data[r][j].reviews[i].comment && (
<div className="comment">{data[r][j].reviews[i].comment}</div>
)}
</div>
</div>
);
}
Expand Down
65 changes: 65 additions & 0 deletions src/pages/ViewTeamGrades/grades.scss
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,68 @@
margin: auto;
}
}

.round-heading {
font-weight: bold;
margin-top: 20px;
font-size: 30px;
}

.review-heading {
font-weight: bold;
margin-top: 10px;
}

.review-block {
border: 1px solid #ccc;
padding: 10px;
margin-bottom: 0;
}

.question {
font-weight: bold;
}

.score {
background-color: #4caf50;
border-radius: 50%; /* Makes it circular */
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
color: black; /* Text color */
margin-right: 10px; /* Space between score and comment */
font-weight: bold; /* Make the score text bold */

}

.comment {
flex-grow: 1; /* Ensures comment fills the rest of the container */
padding-top: 3px;
}

/* Style for even-numbered review blocks */
.review-block:nth-child(even) {
background-color: #d9edf7;

}

/* Style for odd-numbered review blocks */
.review-block:nth-child(odd) {
background-color: #fcf8e3;

}

.score-container {
display: flex;
align-items: center;
margin-top: 5px;
padding-top: 10px;

}


.review-container {
margin-bottom: 200px;
}

0 comments on commit d2297f8

Please sign in to comment.