diff --git a/trivia-forge/frontend/src/App.jsx b/trivia-forge/frontend/src/App.jsx index ca716e8..2116c59 100644 --- a/trivia-forge/frontend/src/App.jsx +++ b/trivia-forge/frontend/src/App.jsx @@ -1,13 +1,13 @@ import { useState } from 'react'; import './App.css'; import { BrowserRouter, Routes, Route } from "react-router-dom"; -import Home from "./pages/homePage"; -import Navigation from "./components/Navigation"; -import TriviaGenPage from './pages/triviaGenPage'; -import TriviaReviewPage from './pages/triviaReviewPage'; -import MyTriviaPage from './pages/myTriviaPage'; -import LoginPage from './pages/loginPage'; -import SignUpPage from './pages/signUpPage'; +import Home from "./Pages/HomePage"; +import Navigation from "./Components/Navigation"; +import TriviaGenPage from './Pages/TriviaGenPage'; +import TriviaReviewPage from './Pages/TriviaReviewPage'; +import MyTriviaPage from './Pages/myTriviaPage'; +import LoginPage from './Pages/LoginPage'; +import SignUpPage from './Pages/SignUpPage'; import React from 'react'; import 'bootstrap/dist/css/bootstrap.min.css'; diff --git a/trivia-forge/frontend/src/Components/ReviewCategories.jsx b/trivia-forge/frontend/src/Components/ReviewCategories.jsx index 0a107fd..92d6978 100644 --- a/trivia-forge/frontend/src/Components/ReviewCategories.jsx +++ b/trivia-forge/frontend/src/Components/ReviewCategories.jsx @@ -1,17 +1,17 @@ import React from "react"; -import ReviewQuestions from "../components/ReviewQuestions"; +import ReviewQuestions from "../Components/ReviewQuestions"; function ReviewCategories({ category, index, changeValue, isMultipleChoice }) { let questions = category.questions; const path = ['categories', index]; - + return (

{category.title || category.name}

{questions.map((question, index) => { return ( - + ); })}
diff --git a/trivia-forge/frontend/src/Components/ReviewQuestions.jsx b/trivia-forge/frontend/src/Components/ReviewQuestions.jsx index eb11cd5..30d3341 100644 --- a/trivia-forge/frontend/src/Components/ReviewQuestions.jsx +++ b/trivia-forge/frontend/src/Components/ReviewQuestions.jsx @@ -1,7 +1,7 @@ import React from "react"; -import ReviewChoices from "../components/ReviewChoices"; +import ReviewChoices from "../Components/ReviewChoices"; import { Card } from "react-bootstrap"; -import { Question } from "../models/question"; +import { Question } from "../Models/Question"; //logic for button to generate new question @@ -22,7 +22,7 @@ function ReviewQuestions({ data, path, index, changeValue, isMultipleChoice }) {

Question

{/* //Button to generate new question somewhere in here */}
- +
{isMultipleChoice && ( @@ -30,7 +30,7 @@ function ReviewQuestions({ data, path, index, changeValue, isMultipleChoice }) {

Choices

{choices.map((choice, index) => { return ( - + ); })} @@ -38,12 +38,12 @@ function ReviewQuestions({ data, path, index, changeValue, isMultipleChoice }) {

Answer

- +

Hint

- +
diff --git a/trivia-forge/frontend/src/Pages/SignUpPage.jsx b/trivia-forge/frontend/src/Pages/SignUpPage.jsx index 5e76180..e2318b8 100644 --- a/trivia-forge/frontend/src/Pages/SignUpPage.jsx +++ b/trivia-forge/frontend/src/Pages/SignUpPage.jsx @@ -2,7 +2,7 @@ import React, { useState } from 'react'; import { useNavigate } from "react-router-dom"; import { Form, Button, Card } from "react-bootstrap"; import { addUser } from '../services/triviaForgeApiService'; -import { User } from '../models/user'; +import { User } from '../Models/User'; function SignUpPage() { @@ -20,7 +20,7 @@ function SignUpPage() { return; } // create new user object with form input values - const user = new User(null, email, password, username); + const user = new User(null, email, password, username); // console.log('Sending user data:', user.toJsonObject()); // call addUser function to add new user to database const addedUser = await addUser(user); @@ -37,7 +37,7 @@ function SignUpPage() { Sign Up
- +
Email address @@ -61,7 +61,7 @@ function SignUpPage() { Confirm Password setConfirmPassword(e.target.value)} /> - +
@@ -201,13 +212,14 @@ function TriviaGenPage() { className="form-control" id="categoryName" placeholder="Category" + required />
))} - +
@@ -230,7 +242,7 @@ function TriviaGenPage() { size="sm" role="status" aria-hidden="true" - style={{display: spinnerVisibility}} + style={{ display: spinnerVisibility }} className="me-2" /> {submitBtnLabel} diff --git a/trivia-forge/frontend/src/Pages/TriviaReviewPage.jsx b/trivia-forge/frontend/src/Pages/TriviaReviewPage.jsx index 66ec508..68aefe0 100644 --- a/trivia-forge/frontend/src/Pages/TriviaReviewPage.jsx +++ b/trivia-forge/frontend/src/Pages/TriviaReviewPage.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { useLocation } from 'react-router-dom'; // used to access passed state -import ReviewCategories from '../components/ReviewCategories'; +import ReviewCategories from '../Components/ReviewCategories'; import { Button } from 'react-bootstrap'; import { AddAllForGame, UpdateAllForGame } from '../services/saveGameService'; import { useNavigate } from "react-router-dom"; @@ -16,7 +16,7 @@ function TriviaReviewPage() { const navigate = useNavigate(); const updateGame = useStore(state => state.updateGame); const addGame = useStore(state => state.addGame); - + console.log(game) const HandleUpdateGame = async () => { @@ -33,7 +33,7 @@ function TriviaReviewPage() { function changeValue(path, key, value) { let current = game - + for (let i = 0; i < path.length; i++) { current = current[path[i]] if (i == path.length - 1) { @@ -54,7 +54,7 @@ function TriviaReviewPage() {
- +
))}
diff --git a/trivia-forge/frontend/src/Pages/myTriviaPage.jsx b/trivia-forge/frontend/src/Pages/myTriviaPage.jsx index 9ef81ea..6d15e67 100644 --- a/trivia-forge/frontend/src/Pages/myTriviaPage.jsx +++ b/trivia-forge/frontend/src/Pages/myTriviaPage.jsx @@ -5,9 +5,9 @@ import Col from 'react-bootstrap/Col'; import Row from 'react-bootstrap/Row'; import Button from 'react-bootstrap/Button'; import Spinner from 'react-bootstrap/Spinner'; -import UnorderedCategoriesList from "../components/UnorderedCategoriesList"; -import QuestionsCount from "../components/QuestionsCount"; -import Slideshow from "../components/Slideshow"; +import UnorderedCategoriesList from "../Components/UnorderedCategoriesList"; +import QuestionsCount from "../Components/QuestionsCount"; +import Slideshow from "../Components/Slideshow"; import Modal from 'react-bootstrap/Modal'; import { Link, useNavigate } from "react-router-dom"; import useStore from '../hooks/useStore'; @@ -52,7 +52,7 @@ function MyTriviaPage() { } }, [userGames]); - function handleGameShow (game) { + function handleGameShow(game) { setCurrentGame(game); setShowGame(true); }; @@ -81,7 +81,7 @@ function MyTriviaPage() { My Trivia
- +
{/* check if there are games to display */} {userGames.length > 0 && ( @@ -132,7 +132,7 @@ function MyTriviaPage() { - + @@ -142,7 +142,7 @@ function MyTriviaPage() { - + diff --git a/trivia-forge/frontend/src/services/triviaForgeApiService.jsx b/trivia-forge/frontend/src/services/triviaForgeApiService.jsx index 411ba75..2af307e 100644 --- a/trivia-forge/frontend/src/services/triviaForgeApiService.jsx +++ b/trivia-forge/frontend/src/services/triviaForgeApiService.jsx @@ -1,8 +1,8 @@ import axios from 'axios'; -import { Game } from '../models/game'; -import { Question } from '../models/question'; -import { Category } from '../models/category'; -import { Choice } from '../models/choice'; +import { Game } from '../Models/Game'; +import { Question } from '../Models/Question'; +import { Category } from '../Models/Category'; +import { Choice } from '../Models/Choice'; const API_URL = 'http://127.0.0.1:5000';