Skip to content

Commit

Permalink
QuestionView CSS added
Browse files Browse the repository at this point in the history
  • Loading branch information
uo289267 committed Mar 2, 2024
1 parent 9197d8a commit 3cc31fa
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
29 changes: 29 additions & 0 deletions webapp/src/components/questionView/QuestionView.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
button{
width: 100%;
height: 45px;
background: darkblue;
border: none;
outline: none;
border-radius: 40px;
box-shadow: 0 0 10px black;
cursor:pointer;
font-size: 16px;
color: white;
font-weight: 700;
}

div {
display: grid;
grid-template-columns: repeat(2, 1fr); /* 2 columns */
grid-template-rows: repeat(2, 1fr); /* 2 rows */
gap: 10px; /* Adjust the gap between grid items */
}

/* Adjust width of child elements */
div > * {
width: 100%; /* Adjust as needed */
margin:1em;
}
p{
text-align: center;
}
6 changes: 4 additions & 2 deletions webapp/src/components/questionView/QuestionView.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Question from './Question';
import QuestionGenerator from './QuestionGenerator';
import { useEffect, useState } from 'react';

import './QuestionView.css';

function QuestionView(){
const questionGenerator = new QuestionGenerator();
Expand Down Expand Up @@ -41,13 +41,15 @@ function QuestionView(){

function QuestionComponent({questions, numQuestion, handleClick}){
return (
<div>
<>
<p>{questions[numQuestion].getQuestion()}</p>
<div>
{questions[numQuestion].getAnswers().map((item, index) => (
<Answer key={index} text={item} onClick={handleClick}/>
))}
<p>Question counter: {numQuestion}</p>
</div>
</>
);
}

Expand Down

0 comments on commit 3cc31fa

Please sign in to comment.