Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/innobln 856 #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "bootstrap/dist/css/bootstrap.min.css";

import Join from "./components/Join/Join";
import Chat from "./components/Chat/Chat";
import Score from './components/Score/Score'
import Score from "./components/Score/Score";

const App = () => (
<Router>
Expand Down
Empty file.
40 changes: 40 additions & 0 deletions client/src/components/Question/Question.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from "react";

// components
import { Form, Button, Jumbotron } from "react-bootstrap";

import "./Question.css";

import { questionData } from "./QuestionData";

const Question = ({ stage, category }) => {

const questions = questionData[stage].filter((obj) => {
return obj.category === category;
});
const random = Math.floor(Math.random() * questions.length);
const randomQuestion = questions[random];

return (
<div className="container-fluid">
<Jumbotron>
<div>{randomQuestion.question} </div>
<br />
<br />
<div>
<Form>
<Form.Group controlId="formGridAddress1">
<Form.Label>Enter your lie here:</Form.Label>
<Form.Control placeholder="lie" />
</Form.Group>
<Button variant="primary" type="submit">
Submit
</Button>
</Form>
</div>
</Jumbotron>
</div>
);
};

export default Question;
Loading