Skip to content

Commit

Permalink
Cleaned up files
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanueposu committed May 30, 2024
1 parent 9d0f4d9 commit 3faada6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 44 deletions.
14 changes: 2 additions & 12 deletions trivia-forge/frontend/src/Components/GameCategories.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import { React, useState, useEffect } from "react";
import { getCategories } from "../Services/TF-db_services";
import { React} from "react";

function GameCategories(game) {
//const [categories, setCategories] = useState(null);
const categories = game.data.categories;



// useEffect(() => {
// getCategories(game.data).then(res => {
// setCategories(res);
// });
// }, []);

return (
<>
{categories && (
Expand All @@ -24,4 +14,4 @@ function GameCategories(game) {
)
}

export default GameCategories;
export default GameCategories;
27 changes: 1 addition & 26 deletions trivia-forge/frontend/src/Components/GameQuestions.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { React, useState, useEffect } from "react";
import { getCategories, getQuestions } from "../Services/TF-db_services";
import { React} from "react";

function GameQuestions(game) {
//const [categories, setCategories] = useState(null);
//const [questions, setQuestions] = useState(null);
let categories = game?.data.categories || [];
function questionCount() {
let count = 0;
Expand All @@ -13,33 +10,11 @@ function GameQuestions(game) {
return count;
};

// useEffect(() => {
// getCategories(game.data).then( res => {
// setCategories(res);
// });
// }, []);

// useEffect(() => {
// if (categories) {
// const category_ids = new Set();
// for (let i = 0; i < categories.length; i++) {
// category_ids.add(categories[i].id)
// };

// getQuestions(category_ids).then( res => {
// setQuestions(res);
// });
// }
// }, [categories]);

return (
<>

<span>{questionCount()}</span>

</>
)
}

export default GameQuestions;

6 changes: 0 additions & 6 deletions trivia-forge/package-lock.json

This file was deleted.

0 comments on commit 3faada6

Please sign in to comment.